StrataFrame Forum

ReadOnly Object?

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

By Larry Caylor - 12/19/2005

Unlike some other frameworks, StrataFrame, uses a single business object type and I’m wondering what would be the best way handle the following situation where a read only object would be helpful.  Using the sample application I’m emulating a publisher/subscriber pattern using events.  On the OrderEntry form the CustomerBO would not normally be updated. However since I’ve added an event handler to display any changes to Customer made on the CustomerMaint form it does get updated and IsDirty is set to True. However I don’t want to save the changes, since they were already saved by the CustomerMaint form.  In CSLA I would have used a ReadOnly CustomerBO on the OrderEntry Form. One solution would be to add a ReadOnly property to the base BO so that IsDirty would not be set to True no matter what changes were made.

By StrataFrame Team - 12/20/2005

Having a ReadOnly property would be nice. At the top of the Save(), we bail out if the business object is not dirty, so we could configure the IsDirty property to always return false on a ReadOnly business object. I would tell you to just ignore the changes and not save the business object, but when you call Save() on the form, it saves all of the business objects no matter what, so, I'll look into this.



ED: I'll do my best to get this included along with the warnings implementation in the next version.
By Larry Caylor - 12/20/2005

Having IsDirty always return False for a ReadOnly object would make it much easier to achieve the functionality I'm looking for. Thanks!