Hi,
I have a data bound tree with check boxes on a screen that allows the user to set properties on quite a lot of business objects (up to 100, or maybe more). If a parent node is checked, it sets boolean properties on all of the business objects bound to the child nodes to true or false accordingly.
I set up these properties following the CSLA pattern, but when I use SetProperty in the property setters on these business objects, it causes a performance issue. If a parent node is checked, it takes more than 10 seconds for the UI to respond, because SetProperty is being called on so many business objects.
I have tried using LoadProperty instead, as I do not have any business rules associated with these properties, but LoadProperty does not mark the business object dirty or run change notification.
I have also tried LoadPropertyMarkDirty, while also manually calling OnPropertyChanging and OnPropertyChanged so that change notification is run. This cuts down the UI response time to 1/4 of when I use SetProperty.
The issue with calling LoadPropertyMarkDirty is that I have found it does not take BypassPropertyChecks into account.
When I'm calling Fetch on the business objects, and using BypassPropertyChecks, when the property value is changed to a value different from the default value, the business object gets marked dirty when LoadPropertyMarkDirty is called.
When using SetProperty, it takes BypassPropertyChecks into account so that, when properties change during a fetch, the business object is not marked dirty. On the other hand, LoadPropertyMarkDirty will still mark the object dirty while using BypassPropertyChecks. This is not the behavior I expected, as it seems to be different than how SetProperty operates in regards to marking the object dirty.
I have tried to somehow manually override the default CSLA behavior, but the problem is that the _bypassPropertyChecks field in Core.BusinessBase is marked private, so I don't have the ability to make a kind of custom behavior based around its value.
If anyone has any ideas to make SetProperty perform faster or get around my issue with LoadPropertyMarkDirty, it would be appreciated.
Thanks,
Jonathan