WCF DataContracts and underlying data structures
Posted
by Xerx
on Stack Overflow
See other posts from Stack Overflow
or by Xerx
Published on 2008-09-17T14:05:34Z
Indexed on
2010/03/08
16:51 UTC
Read the original article
Hit count: 429
wcf
|data-access
I am wondering what makes sense in relation to what objects to expose through a WCF service - should I add WCF Serialization specifications to my business entities or should I implement a converter that maps my business entities to the DataContracts that I want to expose through my WCF service?
Right now I have entities on different levels: DataAccess, Business and Contract. I have converters in place that can map entities from DataAccess to Business and from Business to Contract and vice versa. Implementing and Maintaining those is time consuming and pretty tedious. What are best practices in relation to this?
If I were using an OR/M such as NHibernate or Entity Framework should I be exposing the entities from the ORM directly or should I abstract them the same way I am doing now?
Thanks in advance.
© Stack Overflow or respective owner