StrataFrame Forum

SharedDataTable usage

http://forum.strataframe.net/Topic16462.aspx

By Ertan Deniz - 5/19/2008

For understanding the usage of the Shareddatatable ;

BusinessObject1 and BusinessObject2 are the two objects of same type. These are on different forms.

Each of them has an internal table. Let's say table1 anf table2.

After BusinessObject1.SharedDataTableKey is assigned with a key ( Mykey).

What happens ? (The second Object's SharedDataTableKey has not been assigned yet.)

Does the framework allocate a new datatable for sharing ?

After BusinessObject2.SharedDataTableKey is assigned with the same key ( Mykey).

BusinessObjects2 uses BusinessObject1's internal table as shareddatatable ? Is it correct ?

By Ertan Deniz - 5/20/2008

Any Comment ?
By Trent L. Taylor - 5/21/2008

What happens ? (The second Object's SharedDataTableKey has not been assigned yet.)

Does the framework allocate a new datatable for sharing ?

No.  They share the same data table.  I recommend opening up the source and taking a look as this is the best way to understand how it works.  There is a collection on the BusinessLayer called _SharedDataTables that gets pulled from when accessing the CurrentDataTable of the business object.  If you have the SharedDataTableKey set, it will pull from the shared collection versus the internal data table.  If a key does not exists within the shared collection when accessed, it will then create a data table for that key in the shared data table collection.

By Ertan Deniz - 5/21/2008

Thanks. It is so clear.