Mark Baker's Validation considered harmful

by Rick Jelliffe

Mark's blog item is worth a read: he is working towards an ideal of time-independent validation. I take his essential point to be that different consumers have different constraints as showstoppers, and that it is inefficient, frustrating and wasteful for your input to barf on constraints that don't effect you in particular. For example, if you are just storing a numeric field in a database now and then writing it out later, you don't need to care whether it is in a particular range, just that it is a number at all.

I think there are four kinds of validation strategies, with a natural underwear analogy
* schema used for validating incoming data reflects the public interface (tighty whiteys)
* schema used for validating incoming data only reflects the capabilities of the consuming system (speedos)
* schema used for validating incoming data is a looser family schema that gives some kind of version independence (boxers)
* schema used to validating incoming data only validates traceable business requirements (G-string)

Err, OK lets forget the analogy...


Rick Jelliffe
2006-12-22 03:41:13
Smart sub-Saharan comments on Mark's post