And now, for something completely different..

I officially withdraw my support for the JavaBeans validation/conversion
track :) I'd like to thank everyone for their input on this idea tho., if
nothing else I've learned quite a bit. 

Besides, I might have another abstraction in mind now :) Its actually not
*my* idea becuase it occured to me as I was writing unit tests with JUnit.
For those of you familiar with JUnit, I'm basically thinking of something
like this:

com.myco.struts.ui.MyForm           <<ActionForm>>
com.myco.struts.ui.MyFormValidation <<Validation>>

Where MyFormValidation is analogous to the JUnit TestCase. Essentially, I'd
like the ActionServlet to locate this class by a simple naming convention;
eg. form.getClass().getName() + "Validation". If found, it would load,
instantiate, setup(Serializable form) and run the objects command method
(eg. run()). The command method, in turn would introspect itself and execute
all the "validate" mothods. Each validate method would then be able to
record their respective errors into a member ActionErrors object. The
ActionServlet then retrieves any ActionErrors through the getErrors method.

Vatidation
+ setup(form Serializable) : void
+ run : void
+ getErrors : ActionErrors

Anyway, I'll post more on this later, just wanted to get the idea out there
for feedback (or criticism).

As a side note, I'm a proponent for keeping Validation and Conversion
separate, simply becuase I view each as significant potentially discrete
issues. 

Regards,
Levi Cook

Reply via email to