StrataFrame Forum

Stateful class

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

By Chan - 10/2/2008

Hi,

I have a class that act as bridge between two BusinessObjects. When BO1 add new row, BridgeClass will be notified (eventbinding). Then BridgeClass will call BO2 to add new row as well. BridgeClass able to "sync" CRUD actions.



This class is working fine in WinForm dev. When I use it in WebDev, it doesn't work because everytime postback, Bridge class will be re-created. All settings are gone.



How could I change it so that it is "stateful/persisted"?



Thank you
By Trent L. Taylor - 10/3/2008

You will want to create the bridge BO as a shared instance this way the postback will not continue to recreate the BO.  You can also do this as a defined BO in the ApplicationBasePage as these will be persisted as well.