Scenario: Using a tiered approach with WCF services: business services returning domain / DTO objects to the client. Still in development so we can break the contracts.
Person object has first name and surname. Member object has tax file number and date of birth. This is because, in our domain, only members get tax file numbers and dates of birth. When getting data back from a service using this structure it is clear what attributes are applicable.
Now, we introduce another service that has a usage for person - lets say Employee. in this usage the person object requires the additional attributes tax file number, and date of birth.
What is the best way to proceed?
1) Treat the Person object as a generic Person and include all of the attributes. This maps the Person to a real world person, not necessarily based on usage. This means that services that return Persons will include tax file number and date of birth, even though they may not be relevant.
2) Duplicate the additional fields into Employee. This leaves Person as is, and keeps service calls specific at the expense of duplication.
3) Create another in between object called PersonWithDOBTFN that we inherit from for Member and Employee. This removes duplication, keeps things specific but introduces complexity.
I am really looking for a best practice approach to designing these objects.