This post originated from an RSS feed registered with .NET Buzz
by Udi Dahan.
Original Post: Validate THIS !
Feed Title: Udi Dahan - The Software Simplist
Feed URL: http://feeds.feedburner.com/UdiDahan-TheSoftwareSimplist
Feed Description: I am a software simplist. I make this beast of architecting, analysing, designing, developing, testing, managing, deploying software systems simple.
This blog is about how I do it.
More and more often am I being pushed ( against my will ) to writing posts in response to other posts. Today, Edgar Sanchez did it with his post "Are validation errors exceptions ?" As always, read his post before continuing.
First of all, presentation layer validation is a must. For security reasons, performance reasons, and some more. Personally, I like to wrap up the basic validation ( string length, numeric range, regular expressions ) in the entities themselves. For more information on entities and how they fit into the overarching architecture, see my previous posts. Any data that is received that fails the validation should promtly throw an exception. For example: