This project is read-only.

Validation framework

Oct 14, 2009 at 2:38 AM

Is it possible to share some example on using the validation framework for both server side and client side validation? Also some knowlwdge about best practices will be highly appreciated.

By the way, great job in developing the tool.

Oct 15, 2009 at 4:13 AM

The best practices will be coming soon. As for the validation framework there are a few ways you can add validation. The first is a publish-subscriber model. Each object has events that are fired when a property is changed, like FirstNameChanged event. There is also a generic PropertyChanged event for the object as a whole when anything changes. You can hook into these events and process whatever validation you wish. The other validation method is to use the IValidation interface. Each business object implements this interface. You can override the IsValid and optionally the GetRuleViolations methods. You can create your own validation logic and when an object fails the validation, you simply add a RuleViolation to the collection. The IsValid method will return true only when the collection is empty. An article needs to be written about this subject and is on the to do list.