Enterprise Library will have a new block – Validation Application Block
It looks like the new version of the Enterprise Library will have a new block – Validation Application Block. It will provide common validation rules that apply to primitive data types.
What a great idea, hopefully this would be as easy and nice as BO validation in RoR. One of my problems with ASP.NET validators is that they force you to put business logic into UI. And this leads to the duplication of the validation logic. Now you have to write your validation logic in your business object and in your UI. That is if you ever do… I have seen so many examples where people just put all their validation into UI and never replicate it on the BLL. Not cool… I like the Rails way better. You always start out by coding validation logic in your BO, and UI knows how to pick up all the validation errors and display them to the user.
From the post:
The Validation Application Block will include a comprehensive library of common validation rules that apply to primitive data types. For example, we’ll include rules like string length, numeric range, date range, regular expressions and so on. However your applications will typically deal with more complex objects such as Customers or Orders (yes, here at Microsoft we assume every application is based on Northwind ;-), so while the built-in Validators should be great building blocks, you’ll need to do some additional work to specify how these primitive rules apply to more complex objects. We plan on letting you do this in two primary ways: in configuration (which is ideal if you want the rules to be easily changed after deployment), or in code (which allows better encapsulation of rules and ensures the behavior won’t change unless the code does).
The complete post is here.
No comments yet. Be the first.
Leave a reply