What's the experts opinions on the best way to create a DTO in the latest released nHibernate (or the latest dev build if different). I've just finished implementing a select new query and some of the things I wasn't to found of include:
  • Have to create a new DTO object which pollutes my domain. I needed a DTO since this entity also has a binary document with it which I don't want to load unless we really need it so the DTO is handy to populate the UI. I wonder how this might change with the DLR if at all... I also don't think criteria and projections will help.
  • Have to add a new mapping to import this type in nHibernate.
  • Getting the syntax right was a real pain for a novice like me. Main issue was just making sure I was referring to the classes and not the tables. Its so close to SQL i keep forgetting this one.
The way I solved these was to define a common interface that my DTO and entity object share which in my case since they are both the same heirarchy works. I then stuffed my DTO back in the library with all dao's which kept the domain clean.

Anyways curious on your thoughts.

Josh

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "nhusers" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to