Hello all,

I'd really like to use the validation part of incubator, but I'd like
to do the following updates and design changes:

Update to use Java 1.5 features that are now available
--------
This is pretty straight forward. I would use typed lists in
AbstractValidationController, make Subject a generic interface (for
the value returned), and other minor changes.

Use interfaces instead of abstract classes
--------
A lot of the main validation classes are abstract classes. Some
examples are ErrorHandler, AbstractValidationController and Validator.
This creates a lot of problems for unit testing these classes because
you can't really mock them out, you have to instantiate them, etc.
Therefore, I think it's better to make these classes interfaces and
make an abstract concrete implementation that includes the current
code.

Write test cases
--------
The validation library is currently missing unit tests, I'd like to
add extensive tests. I wanted to use EasyMock (http://
www.easymock.org/) for testing some of the stuff that doesn't involve
GWT.create() calls. EasyMock is under the MIT license, is it
acceptable to use and include?

Remove static methods
--------
There are a number of static methods scattered around in classes like
the DefaultTextBoxSubject, RegExValidator and ValidatorController.
Static methods really make testing hard, and global states are in
general bad. Is there a specific reason for these static methods?

Annotation based validation
--------
What do you think about annotation based validation? It could look
something like this:

@NotEmptyValidator
TextBox firstName = new TextBox();

@NumberRangeValidator(low = 18, high = 100)
TextBox age = new TextBox();


Let me know what you think. Thank you.

Regards,
Arthur Kalmenson
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to