Adapter and LazyLoading

Posts   
 
    
Posts: 4
Joined: 23-Jan-2006
# Posted on: 23-Jan-2006 16:01:40   

I read in the doc that Adapter scenario does not support LazyLoading. Although, I understand the idea behind it (distributed systems...), I don't understand why we, as users, don't have the option to choose when to use lazy loading and when prefetch paths in the Adapter scenario, as we have in the self servicing. Thanks!

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 23-Jan-2006 16:54:33   

Lazy loading can be easily implemented in code. Just skip the prefetch paths and fetch related entities when you want. Thus giving you better control over the application behaviour.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 23-Jan-2006 17:08:33   

To elaborate a bit more: adding lazy loading also breaks rules like 'GUI code should always consult BL code for data - access'. Adapter is developed to prevent GUI developers (for example, other scenario's are possible) to take shortcuts for example and use lazy loading instead of teh BL code.

Frans Bouma | Lead developer LLBLGen Pro
mihies avatar
mihies
User
Posts: 800
Joined: 29-Jan-2006
# Posted on: 29-Jan-2006 20:23:32   

Otis wrote:

To elaborate a bit more: adding lazy loading also breaks rules like 'GUI code should always consult BL code for data - access'. Adapter is developed to prevent GUI developers (for example, other scenario's are possible) to take shortcuts for example and use lazy loading instead of teh BL code.

How do you merge code in distributed scenario? For example, let's say that I have a customerentity instance and I want to fetch its orders. I will ask BL to fetch the orderentitycollection via serialization/deserialization. Now, how am I going to attach the fetched collection to customerentity?

PS: Frans, you should really use a spell checker to avoid tehwink

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 29-Jan-2006 21:12:48   

mihies wrote:

Otis wrote:

To elaborate a bit more: adding lazy loading also breaks rules like 'GUI code should always consult BL code for data - access'. Adapter is developed to prevent GUI developers (for example, other scenario's are possible) to take shortcuts for example and use lazy loading instead of teh BL code.

How do you merge code in distributed scenario? For example, let's say that I have a customerentity instance and I want to fetch its orders. I will ask BL to fetch the orderentitycollection via serialization/deserialization. Now, how am I going to attach the fetched collection to customerentity?

customer.Orders.DoNotAddIfPresent =false; customer.Orders.AddRange(readCollectionFromServer);

simple_smile This also sets every order's Customer reference to the customer object holding the Orders collection.

PS: Frans, you should really use a spell checker to avoid tehwink

I know I know wink . Sometimes I miss a few typo's wink

Frans Bouma | Lead developer LLBLGen Pro