Hi David,

good to see the validator config being revamped. Here's my 2 cents:

Instead of renaming form->bean I'd be inclined to rename it to 'validation'
as that is what it is.

I'd also be inclined to replace the 'depends' attribute with a collection of
1 or more elements that hold the validators to apply. Any overriding msg
element could then be contained within these validator-application tags.
This is the main area of the current validator descriptors that I have found
causes confusion.

Ie I'd argue for more structure to the new definition file that the current
one provides. Make it clear (via containment) which piece of the definition
applies to which objects instead of using references.

I'd also like to see a Validator interface introduced. Ie instead of
defining the class, method, params in the validator config, just define the
class that implements Validator. I don't think this would be an onerous
restriction on validator implementations and would seem to simplify the
framework.


William


----- Original Message ----- 
From: "David Graham" <[EMAIL PROTECTED]>
To: "Struts Developers List" <[EMAIL PROTECTED]>
Sent: Saturday, November 13, 2004 9:47 AM
Subject: Re: The Future of Struts Validation?


> I've written a proposal for what Commons Validator 2.0 xml might look like
> here:
> http://jakarta.apache.org/commons/validator/validator_2_0_0_proposal.dtd
>
> It's an attempt to simplify things as well as make validator more flexible
> for web and non-web usage.  Comments, criticisms, and suggestions are
> welcome!
>
> David
>
> --- William Ferguson <[EMAIL PROTECTED]> wrote:
>
> > I posted his on the users list when I probably should have posted it
> > here.
> > So here' the repeat from those not lurking on both lists.
> >
> > I've create an enhancement on Bugzilla relating to this post at
> > http://issues.apache.org/bugzilla/show_bug.cgi?id=32217.
> >
> > --------------------------------------------------------------
> >
> > Now that I've had a year or so or heavy Struts use, I've come to believe
> > that (IMHO) validation within Struts is a little less clear and concise
> > than
> > it could otherwise be with a few small changes.
> >
> > Currently, validation is defined by specifying a true/false value for
> > the
> > 'validate' attribute for an ActionMapping, and which validation to
> > perform
> > is defined by either the ActionMapping's (Form) 'name' or 'path'
> > attribute
> > depending on whether the Form extends from ValidatorActionForm or not.
> >
> > It seems to me that it would be clearer to introduce a 'validation'
> > attribute into ActionMapping which defines the Id of the validation (if
> > any)
> > to perform. This would supercede the 'validate' attribute and removes
> > the
> > responsibility of identifying the validation target from the combination
> > of
> > the (Form) 'name' attribute and the ActionForm inheritance hierarchy.
> >
> > It also allows all the benefits of using (currently) using a
> > ValidatorActionForm to validate based on ActionMapping path, plus those
> > of
> > using Form named mappings, while also allowing the freedom to mix, match
> > and
> > reuse validations across ActionMappings.
> >
> > It should be easy to make this new addition entirely backward
> > compatible. Ie
> > If 'validation' attribute is not found then look for current attributes
> > and
> > follow the existing validation path, at least for some deprecation
> > period.
> >
> > Specifying no validation for an ActionMapping would be as simple as
> > "validation='None'" with a validation entry for now speciying no fields.
> >
> > Once this refactoring has been achieved, it also opens up the
> > possibility of
> > further enhancing the existing validation mechanism. Ie Allowing
> > validations
> > to contain other validations etc. Though I would first start by
> > simplifying
> > the validation definitions, which I also find somewhat non-intuitive at
> > times.
> >
> > Anyway, just my 2 cents.
> >
> > I'd like to thank the Struts development community for a pretty decent
> > framework, especially those worked on Tiles - it really rocks!
> >
> > William Ferguson
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Check out the new Yahoo! Front Page.
> www.yahoo.com
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to