Hi all,
I have the following database tables to work with and i am sort of new to oop so i thought i'd ask here.
assignment
----------
id
person_id
assigned_address_id
position_id
person
----------
person_id
current_address_id
name
ssn
drivers_license
address
---------
id
address_number
address_street
address_city
address_state
address_zip
position
---------
id
description
rate
I have created the following classes
Person Class
int? id
Address currentAddress
string Name
string ssn
string drivers_license
PersonAssignment Class
id
person_id
Address assignedAddress
Position assignedPosition
Address Class
string address_number
string address_street
string address_city
string address_state
int address_zip
Position Class
int? id
string description
double payment_rate
I've also created Seprate Service Classes for each of the objects which access the Dal.Repository and perform crud methods on each of the objects. i.e.
PersonService Class
Update(Person p)
Insert(Person p)
GetListOfPeople()
GetPerson()
PersonAssignmentService Class
Update(PersonAssignment p)
Insert(PersonAssignment p)
GetListOfPeopleAssignments()
GetAssignment()
I also have Repositories for Each of the Objects
i.e.
PersonRepository Class
Update(PersonAssignment p)
Insert(PersonAssignment p)
GetListOfPeopleAssignments()
GetAssignment()
On my webpage which contains both a persons assignment and the persons personal details i find myself calling PersonService and PersonAssignmentService.
This just seems like a lot of work. Am i doing something wrong? Maybe there a more simple way to design something like this and i'm just not getting it.
Thanks for any help
Thanks