--- Erik Hatcher <[EMAIL PROTECTED]> wrote:
> On Wednesday, June 25, 2003, at 09:52  AM, David Graham wrote:
> > The generalized tag would be:
> > <custom:label key="some.label.key" property="fieldName"/>
> >
> > I don't see that as being much harder to use than the custom version.
> 
> But I hate duplication!  :)  In my case it would look like this:
> 
>       <custom:label key="FormName.fieldName" property="fieldName"/>
> 
> There is no point in me duplicating the field name.  In fact, perhaps 
> the default behavior could simply be this:
> 
>       <custom:label property="fieldName"/>
> 
> Where the form name is obtained from the parent <html:form> tag, and 
> the key name defaults to FormName.fieldName.  Is that an unreasonable 
> default behavior?  I shy away from making "conventions" be built-in, 
> but duplication also sucks.  Thoughts?

Shortcuts like that are very confusing to people trying to maintain your
app.  Transparency is a *very* important feature of tags which is why key
should be the full key name into the resources and property should specify
the form field just like other Struts tags.  It's very confusing for users
to try and figure out what kind of magic a tag is performing and I don't
want to answer a lot of struts-user questions on what should be a simple
tag.  I will *always* use more keystrokes if it makes the app clearer.

David

> 
> > These 2 features are rather specific to your needs.  Customizing a 
> > Struts
> > label tag to add them seems appropriate.
> 
> Let's make sure the tag we create is subclassable nicely then :)
> 
> > Struts can't build in all of the features specific to your app (like 
> > the
> > database functionality).  I think an appropriate goal is to create a 
> > label
> > tag that most people can use easily and can be subclassed to add
> custom
> > features.
> 
> Actually the database functionality is not at all part of the tag 
> itself.  Its just using the Struts resource mechanism, which 
> (irrelevant to the tag code) is a custom MessageResources 
> implementation.
> 
>       Erik
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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

Reply via email to