If project is small enough, and you don't have various clients for your services, then this is the simplest solution and perfectly applicable.
I don't see any value in any left-right mapping if the (only) client is going to construct the same set of entities of a domain, which is most likely to be anemic. But that's a very common case out there and DTO s are YAGNI in this sense. DTOs are not silver bullet. But if project is beyond trivial,and you have some time to invest - I am with you. As a solution to the problem, on your entities you just need to define them as DataContract and that's it. This is not a special case for NH, for all objects on the wire with WCF. They don't necessarily need to be XML Serializable, once they are DataContract Serializable. Hope these make sense. Sidar On Tue, Oct 28, 2008 at 6:10 PM, Sebastian Jancke < [EMAIL PROTECTED]> wrote: > Why do you want to do that? Domain objects are not suited to be sent > over wire, they are to fine grained. Remember Fowler's first law of > object distribution: do not distribute. Further, using domain objects in > your remoting services introduces coupling between services, sensitivity > to domain model refactorings/redesigns (which are frequent by nature) > and it introduces serious versioning problems. > > My advice would be to use some form of DTO, that is mapped in the > service layer to shield remoting and domain model. That way you can > protect both. This is an approach typically used withing SOA and > distribution szenarios. Remind not to reuse DTOs among services. > > -Sebastian > > N.D. schrieb: > > hey all, anyone has such experience or can reference to resources? > > I understand there are some properties that needs to be attached to the > > entity in order to make serialization with WCF happen, and that > > serializing to XML > > is one solution > > > > thanks > > > > > > > > > -- Sidar Ok http://www.sidarok.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to nhusers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---