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

  • Home
  • SEARCH
  • 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 8293631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:53:40+00:00 2026-06-08T13:53:40+00:00

I have a web client that calls my WCF business service layer, which in

  • 0

I have a web client that calls my WCF business service layer, which in turn, calls external WCF services to get the actual data. Initially, I thought I would use DTOs and have separate business entities in the different layers… but I’m finding that the trivial examples advocating for DTOs, to be, well, trivial. I see too much duplicate code and not much benefit.

Consider my Domain:

Example Domain
I have a single UI screen (Asp.net MVC View) that shows a patient’s list of medications, the adverse reactions (between medications), and any clinical conditions (like depression or hypertension) the patient may have. My domain model starts at the top level with:

   MedicationRecord
      List<MedicationProfile> MedicationProfiles
      List<AdverseReactions> Reactions
      List<ClinicalConditions> ClinicalConditions

   MedicationProfile is itself a complex object
      string Name
      decimal Dosage
      Practitioner prescriber 

   Practioner is itself a complex object
      string FirstName
      string LastName
      PractionerType PractionerType
      PractionerId Id
      Address Address    

      etc.

Further, when making the WCF requests, we have a request/response object, e.g.

   MedicationRecordResponse
      MedicationRecord MedicationRecord
      List<ClientMessage> Messages
      QueryStatus Status

   and again, these other objects are complex objects
   (and further, complicates matter is that they exist in a different, common shared namespace)

At this point, my inclination is that the MedicationRecordResponse is my DTO. But in pure DataContracts and DTO and separation of design, am I suppose to do this?

   MedicationRecordResponseDto
      MedicationRecordDto
      List<ClientMessageDto> 
      QueryStatusDto

   and that would mean I then need to do
      MedicationProfileDto
      PractitionerDto
      PractitionerTypeDto
      AddressDto
   etc.

Because I have show almost all the information on the screen, I am effectively creating 1 DTO for each domain object I have.

My question is — what would you do? Would you go ahead and create all these DTOs? Or would you just share your domain model in a separate assembly?

Here’s some reading from other questions that seemed relevant:

  1. WCF contract know the domain
  2. Alternatives for Translation Layer in SOA: WCF
  3. SOA Question: Exposing Entities
  • 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-06-08T13:53:42+00:00Added an answer on June 8, 2026 at 1:53 pm

    Take a look on excellent articles

    • Why You Shouldn’t Expose Your Entities Through Your Services
    • DTO’s Should Transfer Data, Not Entities

    above links don’t work, looks like a domain issue (I hope it’ll be fix), here is the source:

    • DTO’s Should Transfer Data, Not Entities
    • Why You Shouldn’t Expose Your Entities Through Your Services
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have WCF web service and client that calls this service, This client will
I have a web service in WCF that consume some external web services, so
I have a complex RIA client that communicates with a WCF SOAP web service,
I have a Linux/c client app that connects to a WCF web service over
I have a WCF web service that exposes several business methods. I also have
I have a Java Client that calls a web service written in Csharp by
I have a web service client that has an Authenticator class. The Authenticator requires
I have a .NET Web Service running in VS2005 and a client that consumes
I have a have Winforms client that uses Web services on a IIS7 (W2008)
I have a windows forms client that consumes an ASP.net web service. It's my

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.