DTOs vs Serializing Persisted Entities

前端 未结 5 1526
萌比男神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:09

    I've always had problems sending nHibernate objects over the wire. Particularly if your using a ActiveRecord model. and/or if your object has ties to the session (yuck). Another nasty result is that nHibernate may try and load the object at the entry of the method (before you can get to it) which can also possibly cause problems.

    So...getting the message here? problems, problems problems...DTO's all the way

提交回复
热议问题