"Hensley, Richard" wrote:
> 
> I agree with Jon, Paulo, and Daniel.
> 
> It sounds very cool on the outset, however it reminds me of my C++ days
> where default parameters caused so much confusion for programmers
> unfamiliar with the code base that they needed classes before they could
> even read the code. i.e. way to many magic tricks up the sleeve.
> 
> -1
> 
> Please keep Velocity simple meaning easy to read a template, and easy to
> predict what a template will do because all the information is present.
> 
> Richard Hensley

To all the people that said no we don't need an "enhanced" macro directive:

This thread is missing the intention of the original poster. The motivation 
for the original post was the Struts/Velocity integration that has been 
discussed in another thread. Let me try to summarize.

Struts comes with some powerful JSP custom tag libs to support the view designers. 
These tag libs include, for example, a client side form validation library 
(check for required form input, check syntax of form input, check value range
of form input, etc. etc.). If you have been following the Struts mailing lists
you have seen, that people find these tags libs very productivity-enhancing 
for their projects. 

These custom tag libs are not the core of Struts, but I am certain that many Struts 
developers wouldn't want to miss them. If Velocity is to be integrated with
Struts, we would have to provide a Velocity-based alternative.

Now, the property of these custom tags is that they typically have many parameters,
few of them are required, many are optional and have default values. Here
a simple example:

<html:text property="mailingAddress.street" value="Clark St."/>

This tag generate sa text input form field. It name is "mailingAdress.street"
and its default value is "Clark St." This tag has another 25(!) parameters.
You never need all of them, in many practical cases just a handfull. This 
introduces the need/wish to have some kind of function/macro calls with optional 
parameters.

Now, two interesting questions arise:

1) How could we implement the functionality of these customs tags if Velocity
is used as a view technology instead of JSP? One proposal was to use the
existing macro functionality. Other ideas? (Remember: If we are going to 
integrate with Struts we have to provide an alternative to the custom tags lib.
Whether or not we should integrate with Struts is another question.)

2) Much effort has been invested into developing JSP custom tag libs. Some of
them have been proven to be very useful. For many of the custom tag libs the
source is openly available. It would be very interesting if Velocity were able
to use the implementations of the existing custom tag libs. A superficial
investigation shows that this might be "quite" easy to achieve. Any ideas on
this? 

Or, are you of the opinion that a Velocity/Struts integration is fundamentally 
a bad idea?

Our team is using Struts in our projects today and would be very interested to be 
able to use Velocity instead of JSP as the view technology.

Gabe





--
Gabriel Sidler
Software Engineer, Eivycom GmbH, Zurich, Switzerland

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

Reply via email to