I think this problem is common in web applications with an average model. Say I have a SportCenter class that contains a BasketballField list when showing reservations or properties of a basketball field. I still want to show some information about the SportCenter to which it belongs.
I use ASP.Net MVC and nHibernate for the data layer, so my question is: is it worth loading nHibernate the entire SportCenter instance (actually contained in the collection, lazy, but still the class is “heavy”) along with my BasketballField and its information so that Show only a few Sportcenter fields?
On the other hand, building very finely tuned queries in HQL brings me back to the old Classic ASP days with manual SQL queries ...
Any best practice to offer?
Thanks, Peter.
Peter source
share