Note that there are some explanatory texts on larger screens.

plurals
  1. POClass Design Help
    primarykey
    data
    text
    <p>I have the following database tables to work with and i am sort of new to oop so i thought i'd ask here.</p> <pre><code>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 </code></pre> <p>I have created the following classes</p> <pre><code>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 </code></pre> <p>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.</p> <pre><code>PersonService Class Update(Person p) Insert(Person p) GetListOfPeople() GetPerson() PersonAssignmentService Class Update(PersonAssignment p) Insert(PersonAssignment p) GetListOfPeopleAssignments() GetAssignment() </code></pre> <p>I also have Repositories for Each of the Objects</p> <p>i.e.</p> <pre><code>PersonRepository Class Update(PersonAssignment p) Insert(PersonAssignment p) GetListOfPeopleAssignments() GetAssignment() </code></pre> <p>On my webpage which contains both a persons assignment and the persons personal details i find myself calling PersonService and PersonAssignmentService.</p> <p>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.</p> <p>Thanks for any help</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload