Just completed work on a Asp.Net validation framework using Windows Workflow for a client. The client maintains a host of medical related data collection applications and needed a unified framework for validations for them for the client and code behind. They wanted to write validation rules once and use them in multiple contexts: client side via Javascript and in code behind as plain C# web service calls. I designed and built for them a validation framework that consisted of
1. asynchronous javascript validation using custom validators
2. an XML web service that is called by javascript to execute validation rules that are expressed as workflow rules conditions (Business Rules Execution Service)
3. ORM data mapping objects that workflow rule conditions are mapped to
4. a business rules editor that leveraged the ruleset dialog editor to provide for editing rules.
The system is in the final test phases now. I am writing an article on it that I hope gets picked up by someone if not I will post here.
This approach works for several key scenarios:
1. Complex validations that are difficult to express in just javascript.
2. There is a need to store validation rules in the database
3. There is a need to use the same validation rules in multiple contexts: client side, code behind, web service, etc.
Performance considerations are not what you might think. A form with 50 elements and dozens of validation rules still takes about 200 ms round trip for the Business Rules service. Workflow rules conditions have execution times approaching those of plain C#. LinqToSQL mapping classes (what the rules conditions are bound to) have good hydration times from the db (100 ms or less for even large data mapped objects).
For inquiries or more specifics either look for my article when it is somewhere or email me.