jacksonpd
05-17-2005, 12:00 AM
Hi there,
I was wondering if anyone know of any standard business level validation tools / frameworks along the lines of the apache commons validation.
I was also wondering if it was possible to tie this up with the ValidatorSummary so we have a single point to report errors?
Paul
Ted Husted
05-18-2005, 01:58 PM
I don't know of any out there now (on the .NET side), but I would be interested in contributing to one.
I'm very keen on doing most of the validation on the business layer, and then sharing the configuration with the presentation layer, so that it can inject client-side scripts. (As the Commons Validator does, or at leat tries to do.)
In the Java world, my favorite validator is FormProc [https://sourceforge.net/projects/formproc/].
The concept here is that it takes a IDictionary or property object for input and creates another IDictionary or property object as output.
Personally, I think validation without conversion and formatting only solves a third of the problem :shock:
I'm prototype something now that does validation, conversion, and formatting as a unified process. Any any error messages in the Struts "ActionError" or Commons Resources format. It's still rough, but it is working. ;)
The message format is essentially an IDictionary of ILists, where the IDictionary key is the name of the offending field, or some generic identifier or category. I think the .NET KeyValueCollection may be equivalent.
Right now, I'm just displaying the messages in a summary form attached to a Label. But, it wouldn't be hard to loop through the control collection and attach specific messages to specific labels.
Client side scripts could also be generated by consulting the validator's configuration file, which is what Commons Validator does.
-Ted.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.