VAB Validators

Topics: Validation Application Block
Dec 1, 2007 at 9:15 PM
Hi,

I have an ASP.NET web app that uses the VAB integration assembly to validate UI input for business entities. For simple validation it works very well, however when working with composite entities and more complex logic I have had to create several custom validators that I believe would be useful for the VAB block.

PropertyName
The VAB ASP Integration does not allow self validation, a property name always has to be supplied, would it be possible to add a functionality to allow methods, fields and self validators?

And Composite Validators
Would it be possible to add a message template for validation failure
All child validators within the composite validator are processed irrespective of whether the preceeding validator fails. Would it be possible to add functionality to terminate it at the first failure?

Or Composite Validators
I realise that the or composite validator has a message template in the case where all child rules fail, would it be possible to add functionality that would report all child errors on total failure of the OR block rather than using the Or Composite Validator message template. I have found that in some cases where my logic is fairly complex the generic message template is hard to desribe the validation failure

Property Comparison
I have created a custom property equals validator because the property comparison validator only allows properties to be compared on their actual values rather than a supplied value. Originally I thought I could achieve property comparison with the Object validator, a different ruleset and a And Composite validators, however the Object validator does not appear to work very well with ASP.NET integration. Would it be possible to add a Property Equals validator.

Object Validator
The VAB ASP.NET integration requires a property name to be supplied, therefore on all of my Business entities I have added a "Myself" property, which is basically property that allows access to the entire object rather than a single property. Would it be possible to use the object validator to validate "Myself" (the entire business entity) using a different ruleset?


Some of the above functionality may be available already especially with the obejct validator, if so could someone provide some examples how to configure up the VAB to get the Object validator to work.

Thanks,
Gavin