Over the last week I have been playing around with the fluent validation framework on codeplex.
The reason I have been using it is because I needed a validation framework that I could easily construct rules with and change over time. For example, an order does not require payment details until the user is checking out, so as the state of the order is changing from adding items, to purchasing items to printing the receipt, the requirements for validation against the order object are as well! Being able to construct the validation using predicates on the validation call makes this process easy.
The framework allows chaining of rules, nesting of object validators and custom validators should you need them, I find it much more practical than attribute based validation on object properties that have no concept of state, and easier to maintain and define than using XML in the Enterprise library.
So for me it is an excellent solution giving the flexibility I need using generics and predicates in a very practical way
0 comments:
Post a Comment