Do i need to load the entire business object when only binding part of its data?

Do i need to load the entire business object when only binding part of its data?

Old forum URL: forums.lhotka.net/forums/t/4678.aspx


jansater posted on Saturday, April 12, 2008

Hi
I've been using CSLA for some time and just upgraded to the 3.5 version. During my time with CSLA i have followed a strict approach of always creating full blown business objects. In our applications (web) we perform a lot databinding and it has all been ok, but the performance penalty of always loading the full objects from the datasource when doing this is starting to show.

Of course we perform caching of the commonly used data, but still i would want to load for example a list of id/name objects from the database when binding to the controls instead of the full blown business objects. These objects should of course be readonly and not contain any business logic...these kind of objects, call them DTO's if you want, are very common in applications and i basically wonder where i should put them and the data access logic that they need.

Lets for example say that i have a Product business object (very large) and i want to show the name/id of all the products in a drop down list in the gui.
Where do i put the data access code. Inside a static method of the Product business object which performs the data access and return ProductDetail objects?

albruan replied on Saturday, April 12, 2008

Have a look at this thread on NVLs ... http://forums.lhotka.net/forums/thread/20388.aspx

jansater replied on Saturday, April 12, 2008

Thank you!

That thread clears some of my questions.

Copyright (c) Marimer LLC