Thursday, April 20, 2006
Disecting CSLA 2.0 - Looking at SimpleDataProvider in depth
One of the most common pitfalls in CSLA 1.0 during updating/inserting a editable business object is we tend to forget to place MarkNew() during deletion, MarkDirty() when saved and MarkOld() during fetching. These are common pitfalls for developers who creates CSLA business objects w/o using templates. With CSLA 2.0, these methods are automatically called after executing your implementation of DataPortal_XXXX() in your business objects.
Disecting CSLA 2.0 - PropertyHasChanged Combo
In CSLA 1.1 you need to call CheckRules() in your set property (if there are rules) and followed by MarkDirty(). With version 2.0, I only need to call PropertyHasChanged() and the CSLA 2.0 framework is responsible for calling the following:
- ValidationRules.CheckRules(PropertyName)
- MarkDirty()
- OnPropertyChanged(PropertyName)
However in cases you dont want to raise that a property has changed or you want to manually perform the validation rules check, you can still do the 1.1 way.