There are no methods validate addresses, phone numbers, postal codes, zip codes, provinces, states, countries, spelling, lack of accented characters, encodability, character classes or presence of separator chars at fixed positions…
It is much better to spend extra effort to keep bad data out, than to try to detect and remove it later. Never postpone data validation until later! One difficulty with writing data validation classes for things like Zip codes, postal codes, phone numbers etc. is they are based on tables that need to be frequently refreshed. It also best to warn the user of any data validation error as soon as possible, e.g. on the very keystroke or field level. Unfortunately web-based applications are dreadful in this regard, only warning the user after an entire screenful of data have been keyed. Data validation rules should be centralised so that all data are always validated the same way. Unfortunately, Java has no declarative mechanism to enforce all incoming data to be uniformly validated, e.g. design by contract. You must explicitly code it.
This page is posted |
http://mindprod.com/jgloss/validation.html | |
Optional Replicator mirror
|
J:\mindprod\jgloss\validation.html | |
Please read the feedback from other visitors,
or send your own feedback about the site. Contact Roedy. Please feel free to link to this page without explicit permission. | ||
Canadian
Mind
Products
IP:[65.110.21.43] Your face IP:[3.133.146.94] |
| |
Feedback |
You are visitor number | |