Services are not object-oriented. Suppose I have a OOAD based design. We can convert it into DTO (that does not have any behavior) using a Translation Layer. But this can cause be very big increase in amount of code. What are the alternative ideas for this in WCF (via C#)?
Please have your comment whether it is good idea to have such a transition between SOA and OOAD. Should we avoid OOAD altogether when we have SOA or use such mapping techniques?
Is it a good idea to create "Operation Specific DTO" rather than creating "DTO directly from domain after removing behavior" ? Is there any tool for the "Operation Specific DTO Approach"?
Does AutoMapper produce "Operation specific DTO" or "DTO from domain without behavior"?
Note: Operation specific DTO approach can be referred in the answer in “Do not use Abstract Base class in Design; but in Modeling/Analysis”
Extract from Service Layer Guidelines
Design transformation objects that translate between business entities and data contracts.
REFERENCES:
- How to restrict web service data contract properties based on user role
- SOA Question: Exposing Entities
- What is the best way of using DTOs in a SOA application?
- WCF Message & Data Contract, DTO, domain model, and shared assemblies