Well it has been a long time, and much has been happening. Most notably on the technology front is byZero’s adaptation of Microsoft’s MVC3 (soon to be MVC4) web platform. Microsoft’s MVC guru Scott Guthrie has a prolific body of MVC Framework expository and example, if you are uninitiated and wish to learn more start HERE on his blog for a technical overview.
I may espouse the virtues of the Microsoft MVC Framework generally in another post, today I am all giddy about the extensibility afforded through NuGet packages, and specifically the excellent Data Annotations Extensions package produced by Scott Kirkland.
Form validation has long been a tedious necessity on the road to producing robust Web based applications. Web Forms offered a framework that lessened the man-hours required for that task, but in the end even a moderately complex web application requires custom validation. In the end the Client ends up paying the Developer to reinvent the wheel for every car produced. The reason for that is largely due to the tight binding between the validation mechanism and the GUI, or more accurately phrased, the LACK of binding between the Object Model and the validation.
The core MVC Framework Data Annotations functionality goes a long way to transferring the validation away from the front end into the View Model, where it arguably belongs. But the implementation is no-frills, and just covers the basics.
http://dataannotationsextensions.org/ takes that all a step further with the addition of the following validation types:
- CreditCard
- Date
- Digits
- Email
- EqualTo
- FileExtensions
- Integer
- Max
- Min
- Numeric
- Url
Today a client project called for form validation over a range of input data types. A year ago, this task would have added three hours to the project. Today, I installed the Data Annotations NuGet package, annotated my View Model, made a minor adjustment to the View to display the results, and fifteen minutes later the task is done. It is a good thing.
[Read the rest of this article...]