Last post May 05, 2013 05:26 PM by Illeris
Apr 18, 2013 02:41 AM|kashifdotnet|LINK
I am looking at a comprehensive 'Validation' handling mechanism which can be plugged into my business object. The BO must be able to validate itself. Some of the features should include the following:
1. Rules can be added randomly (with some built in rules e.g. Required, Length etc)
2. I may/may not choose to validate a field(s) in the BO depending on the requirement
3. IMPORTANT: The same validation mechanism can be reflected at the Client-side
I am aware of frameworks like CSLA.NET (which is quite huge to grasp) but would prefer to build my own.
Any help is appreciated.
Apr 29, 2013 03:43 PM|Illeris|LINK
Not easy, but manageable. Check codeplex, there might be some samples that can help you further.
I'd like to challenge your design decision : "the bo must be able to validate itself". This is ... a little contradictory... If your validation scheme is not 100% static, you'll need to provide validation scheme logic in the BO. This is in conflict with
the goal of the BO and base design principles.
Use a validator that has knowledge of validation schemes on business objects, and you'll be fine.
May 03, 2013 05:19 PM|sukumarraju|LINK
built in rules e.g. Required, Length etc
Use Enterprise Library: Validation Application block http://msdn.microsoft.com/en-us/library/ff664356(v=pandp.50).aspx
It is feasible to create validators in 3 different ways as
public string CustomerName;
2. Using configuration
3. Through code
Download Microsoft Enterprise Library hands on labs here http://www.microsoft.com/en-us/download/details.aspx?id=6932
May 05, 2013 05:26 PM|Illeris|LINK
@sukumarraju : please enlighten me. Does the EL VAB solve this issue :
I read this as : validation is not always a fixed set of rules, and may vary depending on the application state. Hence, needing multiple schemes per BO.