views:

98

answers:

0

NHibernate mapped objects produce lazy-loading for their references to other objects unless it's set SetFetchMode (Eager) or fetch="eager" attribute. The drawback is that whenever our DAO classes produce the nhibernate-mapped objects for other application tiers (Services, Controllers, UI), they in order may access unloaded proxy references which is performance costly sometimes. Therefore, is it good decision to wrap this nhibernate-mapped objects to some "light-weight" DTOs?

Arguments for: 1) Explicit eager-fetch indication required to fill some specific DTO; 2) No "hidden" lazy load; and maybe some additional.

What do you think?