|
From: Keith D. <kd...@cs...> - 2004-04-05 22:36:12
|
Daniel Miller's spring common validator adapter is now checked in in the
sandbox at:
=20
sandbox/src/org/springframework/validation/commons
=20
Daniel - thanks a lot your contribution! I made some *minor* code =
review
type polishing - be sure to test it to make sure I didn't break =
anything.
:-) Do you have unit tests developed you can contribute as well?
=20
I thought the code and design looked sharp. Good docs, too.
=20
Here were a few things that I noticed on initial review:
=20
- FieldChecks and JavascriptValidatorTag are a port over from the
commons-validator repository (FieldChecks is a particularly lengthy
copy-and-paste bit.) Have you tried delegating to the "real" =
commons-owned
versions of these and adding in the spring adaption stuff via =
decoration?
=20
- several setters must be called to set required =
properties/dependencies
post construction. This is much less of an issue when using the =
container,
but when used programatically it's more difficult to enforce that the =
object
in a valid, usable state. Fully-initializing constructors make more =
sense
to me in these cases (though I have to say I appreciate you documenting
those cases in the comments :-))
=20
- The use of "beanName", when referring to the "formName" (which
typically corresponds to the bean class being validating) confused me a =
bit
(since when I hear beanName I think of a reference to a instance, not a
class.)
=20
- The @TODO for per-request Locale support - could you expand upon =
what
you have in mind here? (do you have a need for working this in the near
future?)
=20
A few other questions I had:
- How often do you use the NamedBeanValidator? When would you use it =
(or
in which cases is the BeanValidator that works with the class name not =
good
enough?
- Anything else you have planned or on the wishlist for declarative
validation?
=20
Keith=20
=20
|