Tim said:
...
> On the topic of simple and clean naming - I do not understand why
> form.getBean() exists.
>
> http://crufty.happysearch.com/velocity/tools/struts/docs/FormTool.html
>
> "getBean() Retrieve and return the form bean associated with this
request."
> QUESTION: Does a Designer really need to know about 'beans'?

does it hurt?  whether using the form bean's name or using $form.bean, the
object is the same.  isn't this question just complaining about the term
being used?

> "This is a convenience method. The form bean is automatically available in
> the Velocity context under the name defined in the Struts configuration."
>
> QUESTION: Why would a Designer ever use a generic $form.bean.username
> instead of $LoginForm.username (assuming the Struts form name is
> "LoginForm")

using the form bean's attribute and/or name is a little extra work.  it's
one more thing that needs to be sync'ed to the struts-config.xml.  it's one
more thing to remember to change if you change the config.  having
$form.bean available means that you always have a consistent interface.  not
a big deal in this case, but i think it's nice to have handy.

> "If the form bean is used repeatedly, it is recommended to create a local
> variable referencing the bean rather than calling getBean() multiple
times."
> QUESTION: What is the benefit of doing this local assignment?
> Optimization/speed

yep.  the ActionForm is not cached in the FormTool, so every
$form.bean.whatever would repeat the whole lookup process.  i don't
particularly recall why it's not cached there.

> QUESTION: Should the "Tools" documentation be written for reading by
> Designers or Developers?

hmm.  must think on this...  what are your thoughts here?

> QUESTION: Similar to Velocity Main which has separate User and Developer
> Guides, perhaps we should have a Guide that is devoted to the Struts
> Designer who is now in VelocityStruts land?

sounds good to me.  i can't say i'll be of much use in this particular area.
i came into this project from Turbine-land.  so, for instance, i know only
enough about JSP to know that i don't like it. :-)

Nathan Bubna
[EMAIL PROTECTED]


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

Reply via email to