Wrox Home  
Search P2P Archive for: Go

  Return to Index  

expert_vb_business_objects thread: Data Access & State Mapping


Message #1 by "Milan Simic" <ngm@E...> on Fri, 28 Feb 2003 17:41:52
I'm getting very curious about new CSLA.NET and very impatient to get the 
book finally :)
I've read all related material on Rocky's web site and analyse all slides 
from VSLive but definitely I miss some major "parts" which I'll discover 
in the book I'm sure. As you can guess, those "parts" are tightly related 
to some specific technical issues.

I'll be so free to post one more subject that interests me and I promise 
that I'm not goin' to announce myself anymore on this forum until I 
receive the book :))

Actually, I'm wondering how objects are being retreived and persisted 
through DataPortal data access regarding the object itself. In former CSLA
all objects knew how to load itself until we introduced Buffer class and 
splitted UI-Centric and Data-Centric logic.

They simply had all data logic implemented and encapsulated and they was 
behaving in the same manner in case of parent-child and stand-alone 
relation. Every parent used to call data access method of every single 
child, so every child knew how to manipulate with data access by itself.

Using Buffer class to serialize objects from UI-Centric to Data-Centric 
ones and viceverse we implemented all data access logic into Data-Centric 
objects.
That's fine but in parent-child relation, the parent was responsible to 
load and save the child, it means that all children will give their state 
to the parent and it will serialize it to the Data-Centric object or 
parent will take the data from Data-Centric object and set children's 
state with it. 

As I release, first case is much more object oriented and encapsulated one 
but its drawback is performance in distributed enviroment, because on this 
way every single object in parent-child relation will send request to the 
server what's very bad in distributed applications especially because DCOM.
Second approach will work much better because with one single shoot from 
parent will do everything we need.

But in both cases data manipulation left partitioned per object. Data-
Centric component would manipulate with data for every single object. 
Actually it will send query to database for every child. Isn't it better 
to manipulate with data just by sending one query which RECEIVES data, 
very hard to update all children with one query :)

The most important is first case, because our objects in CSLA.NET will be 
much more like it, if I'm right. 
If every object knows how to work with data and every parent call their 
methods through collection I believe it will lower our performances 
directly. Isn't it better for parent to propagate all data which it has 
retreived with one query, down to the children's state, especially if it's 
n-level structure than to just call every single child's method?

Thanks to everyone...

Best Regards!

  Return to Index