dgraham 2004/02/18 22:06:24
Modified: validator/xdocs tasks.xml
Log:
Added notes about exception handling, xml file formats, and
dependencies.
Revision Changes Path
1.8 +29 -4 jakarta-commons/validator/xdocs/tasks.xml
Index: tasks.xml
===================================================================
RCS file: /home/cvs/jakarta-commons/validator/xdocs/tasks.xml,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- tasks.xml 15 Dec 2003 06:34:35 -0000 1.7
+++ tasks.xml 19 Feb 2004 06:06:24 -0000 1.8
@@ -33,11 +33,24 @@
<li>
Change the validation.xml file semantics to match a more
general "bean" validation usage.
Currently, the <form-validation>, <formset>,
<form>, and <field> elements
- require a form-centric view of validations. Changing these to
<bean-validation>, <beans>,
- <bean>, and <property> respectively would allow
Validator to be used more easily in
+ require a form-centric view of validations. Changing these to
<bean-validation> or <validator-config>,
+ <beans>, <bean>, and <property> respectively
would allow Validator to be used more easily in
non-form based environments.
</li>
<li>
+ The above changes to validation.xml could only apply to
Validator's native configuration format. We
+ could add a ValidatorResources constructor that accepts a
digester-rules file to allow parsing any
+ XML format into Validator configuration objects. This would allow
higher level frameworks like Struts
+ to use configuration semantics specific to their domain.
+ </li>
+ <li>
+ Examine the need for all dependencies. Validator has many
dependencies that are very lightly used
+ and could be removed. Two likely candidates for removal are
commons-collections and ORO. The first
+ because Validator only uses one class in a very large jar and
backward incompatible changes in recent
+ versions. The second because it can easily be replaced with the
faster and standard Java 1.4 regex
+ engine.
+ </li>
+ <li>
Scenario one:
Replace the Jakarta ORO regex engine with the standard Java
1.4 engine. Preliminary tests show a
50% speed improvement using the standard engine. This will
remove the ORO dependency and
@@ -46,12 +59,24 @@
we also change the configuration file semantics.
</li>
<li>
- More likely Scenario:
- ORO provides a much richer interface to regular expression,
such that we don't have
+ Scenario two:
+ ORO provides a much richer interface to regular expressions,
such that we don't have
to worry about bit twiddling, this includes a pluggable regex
engine. Jeffrey E Friedl states
in Mastering Regular Expressions 2ed, says that in speaking to
the ORO developers that they
will likely develop an adapter to the Java 1.4 regex, See page
378. So we get use of ORO and the speed of
Java 1.4 Regex engine.
+ </li>
+ <li>
+ ValidatorException is only thrown to indicate configuration and
programmer errors
+ yet is a checked exception. ValidatorException should be
converted to a RuntimeException to match its
+ real purpose. Furthermore, the exception handling for pluggable
validations (ValidatorActions)
+ is not well defined or documented. RuntimeExceptions thrown from
ValidatorActions should be propogated
+ out of the Validator framework as is because they indicate
programmer error. Checked exceptions thrown
+ from a ValidatorAction should stop validation and be propogated
out of the framework for handling as these
+ indicate an unrecoverable system failure. Validation method
implementation becomes easier because they
+ can throw SQLException, IOException, etc. instead of wrapping the
exception or defining it as a rule failure.
+ This allows clients to reliably distinguish between a normal
validation failure (invalid data) and exceptional
+ conditions.
</li>
</ul>
</subsection>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]