DTOs vs Serializing Persisted Entities

前端 未结 5 1522
萌比男神i
萌比男神i 2020-12-06 03:48

I\'m curious to know what the community feels on this subject. I\'ve recently come into the question with a NHibernate/WCF scenario(entities persisted at the service layer)

5条回答
  •  伪装坚强ぢ
    2020-12-06 04:07

    If you're asking do I send serialized entities from a web service to the outside world? then the answer is definitely no, you're going to get minimal interoperability if you do that. DTOs help solve this problem by defining a set of 'objects' that can be instantiated in any language whether you're using C#, Java, Javascript or anything else.

提交回复
热议问题