If we are to talk about the philosophy of validations, I would like to
have people think it in a broader context, not only in the web tier.

Let's say we are to validate a person's home address. We need to
ensure the address line, city, state, zip code are entered.
Next, we might need to verify that the city and state are valid names
and the zip code is actual postal zip code (not just 5 digits). Things
get difficult if we want to check the zip code in the database.
If the person is doing refinance, well, we might need to send
an appraiser to the address to perform a survey. They are all business
of *validations*.

What I am trying to say here is that the validation could become
an infinity business :-) It would not be accurate if we say a better
design or practice is to put *all* validation logic in one place.

For example, the DBA would impose declarative constraints
on table columns. That's part of validation business. The foreign
keys, store procedures, etc. could also be part of validation
business.

If we buy this rational, we would know there is no *one* place
for validations. A better design or practice, I believe, would
centralize the validation logic in each of technology layers,
browsers, web tiers, ejb layers, database, etc. Such complicated
problems should be dealt with phases. Using phased validation
models, we could defer the complexity until we really need
it. Without the concept of phases, some software tools are designed
with irrational complexities. For example, if we only need
a required field, why we have to go through so many steps
to achieve it?

Phases will provide a clue to modern application designs. The
browser layer will do phase-0 validations, then the server-side
will do phase-1, phase-2 validations, etc. I hope the rational
will be considered at large...

Jing
Netspread Carrier
http://www.netspread.com




----- Original Message ----- 
From: "David Thielen" <[EMAIL PROTECTED]>
To: "Struts-Users" <[EMAIL PROTECTED]>
Sent: Thursday, August 14, 2003 11:31 AM
Subject: validation philosophical question


Hi;

Everyone who hits my site has a high-speed connection. So I am thinking that
it makes sense to do server side validation only as that provides a better
method than the javascript pop-ups.

And in this case, it seems to me that the logical place for all validation
then is inside the ActionForm validate method.

comments?

thanks - dave


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to