Lists Home |
Date Index |
On Aug 23, 2004, at 9:05 AM, Roger L. Costello wrote:
> Would you mind elaborating more upon what you see as
> the role of validation? Should there be levels of
> validation as I suggested last week? Or perhaps you
> are suggesting that there should be no validation?
I'm not the Michael you asked to respond, but here's the way I see it.
"Syntactical" or "structural" validation of the sort that Schemas,
certain number of mechanical data entry errors, such as leaving out
required items or not putting numbers in fields that require numbers
(e.g. phone numbers, dates, etc.) XML schemas (of one sort or
another) are potentially useful ways to define such constraints,
although as Michael Kay's anecdotes remind us, this is hard to do in a
culture-neutral way, e.g, US postal codes are all numeric, most other
countries' are not. But this is at best a rough check on "validity" in
some business sense.
"Semantic" or "business rule" validation, on the other hand,
essentially cannot be done without accessing a database / knowledge
base to make sure that the request being made can be fufilled. An
obvious example is credit card validation, and for a variety of
technological and security reasons it is going to be done towards the
back end of a dataflow. Trying to force-fit this into schema
validation seems more or less hopeless.
One question I've always had is whether it makes sense to bother with
the structural validation if you are going to have to do the business
rule validation anyway. It comes down to a design decision -- since
it's generally cheaper to recover from errors detected earlier in the
process than later, if you can catch them early with schema validation,
go ahead. But if that is going to be harder to do than it is worth,
e.g. making the data entry screen understand the co-occurrence
constraints between a country code and the format of a postal code, I'm
not at all sure why one would bother.