My comments are inline.

----- Original Message ----- 
From: "Erik Hatcher" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 22, 2003 11:35 PM
Subject: Re: [OS-webwork] xdoclet module


Nice work, Brock!

Some comments below....

On Tuesday, July 22, 2003, at 06:28  PM, Brock Bulger wrote:
> Here is an example of the tag usage:
>
> /**
> * @xwork.field name="created"
> * @xwork.field-validator.required message="created is a required
> field."
> * @xwork.field-validator.date-range
> * min="12-22-2002"
> * max="12-25-2002"
> * message="The date must be between 12-22-2002 and 12-25-2002."
> */
> private Date created;

Why do you need @xwork.field name="..."?  Would you ever make it
different from the actual field name?

I build the <strutsvalidationxml> subtask for XDoclet, and one of the
principles I really was rigorous about was not repeating myself (DRY).
Since one of XDoclet's primary goals is to avoid duplication, I cringe
when I see duplication with XDoclet @tags.  At least, in the case where
the names match up, the name="..." attribute should be omitted and the
default value be the field name itself, I think.

b- Some coding standards use underscores or other prefixes for private
variables in code. This allows the user to specify what the getter/setter
keys off of while still keeping their internal naming convention. This is
also my first attempt at writing an xdt template and it wasn't clear to me
how to grab that name automatically.

Why do you have it tagged on a private field?  XWork is not seeing that
field at all, is it?  What I did on the Struts side of things was have
the setters tagged since that is the entry point for data before it is
validated.  I'm not sure how this differs with how XWork validation
works, so I might be off base here.  But should we be tagging setters
rather than private fields?

b- The setters could be tagged. XWork doesn't see private fields, but keys
off of a fieldname pattern to get/set properties. Most of the actual
validators implement FieldValidator so it made more sense to me to put the
validation code with the fields vs on a setter method.

Since there are XDoclet committers here, I think its reasonable to keep
this subtask in the XDoclet codebase - lots of other 3rd party stuff is
already there, including some earlier WebWork subtasks.

Erik



-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to