Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3403696
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:17:33+00:00 2026-05-18T05:17:33+00:00

Scenario: Using a tiered approach with WCF services: business services returning domain / DTO

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T05:17:33+00:00Added an answer on May 18, 2026 at 5:17 am

    There is a problem with what you are doing – it breaks down under a variety of circumstances. The most obvious case immediately just from your brief example is if a person wants to be a member and an employee. What about when a person no longer wants to be an employee and instead wants to just be a person again?

    Employee and Member are not true “is a” concepts. I may “be” an employee or a member, but that is not really what I truly am or the basis for my identity as an entity. Member and Employee are just two of a large number of roles that we also occupy in the course of being a Person.

    Don’t model a Role with inheritance, it does not work well. Instead just have Person and add a Roles collection that can change, support multiple participations by one person etc.

    The rest ehhh. Map attributes where they logically belong, not based on some kind of policy or previous course of action. Services return whatever you want them to return, the underlying data structure should be logical and prevent duplication.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to implement this scenario using Unity and i can't figure out how
During development I came across a strange scenario using DD with Macedonian_FYROM_90_CI_AS Collation. declare
A common scenario when using source control is to have a development branch along
The Scenario Using jQuery, I have a page that has a popup overlay containing
Hey, This is my scenario: Using visual studio 2008. Project is in c# Using
Here is my scenario: I'm using nhibernate, openning and closing the session in an
The title is the main question. The exact scenario (I am 'using namespace std;'):
Scenario I have a method that returns a list of processes using WMI. If
Example scenario in an ASP.NET application using SQL Server membership provider : 1) a
I'm using WatiN testing Tool I've a scenario where i need to upload a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.