velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Townson, Chris" <C.Town...@nature.com>
Subject RE: The Guardian website moves to Velocity
Date Fri, 11 May 2007 15:28:48 GMT
> Based on what I understand from your system, you need a template
> language only for some very trivial templating tasks, and then it
> really doesn't mater which template engine you are using, so I won't
> start debating if you have to face more complexity or less points of
> extension with FreeMarker. Well, I think you wouldn't, but whatever.
> However, I don't understand the "elegant syntax" part. I would think
> that that:
> 
>   #component("MyComponent", {"id":$myComponent.id})
> 
> is rather less elegant than more elegant than:
> 
>   <@component "MyComponent", id=myComponent.id />
> 

Sure, as I mentioned, the template "client" could, I'm sure, be just as easily implemented
in FreeMarker. The requirements on that side are simple.

As for syntax, welllll - I would never let mere syntax be the ultimate determinant vis-a-vis
a choice between VTL and FM. However, I have to say, I personally prefer VTL syntax and find
FreeMarker very ugly - but, before that starts any arguments, I must emphasize that this is
merely a preference ... however, I do have doctorate in art history and philosophical aesthetics,
so I feel qualified to speak on the matter of beauty! ;D

> Not to mention (that I'm not sure is possible with your system, as I'm
> not sure what the first parameter means):
> 

The first parameter is a component id. In our current prototype implementation using Spring,
this refers to the Spring bean id which is passed by the Velocity client to the "component
loader service" to obtain an instance of the component.

The second parameter (theoretically optional but nearly always required in practice) is a
map containing initialization parameters. Typically, this would be something like a datasource
ID (e.g. for the component to obtain other data from a Db during initialization).

>   <@MyComponent id=myComponent.id />
> 
> where the "MyComponent" is a variable in the context.
> 
> And
> 
>   <h1>${this.heading}</h1>
> 
> is exactly the same with FreeMarker as well. So...
> 

sure - as I say, it could be done equally in FM, I'm sure.

C

********************************************************************************   
DISCLAIMER: This e-mail is confidential and should not be used by anyone who is
not the original intended recipient. If you have received this e-mail in error
please inform the sender and delete it from your mailbox or any other storage
mechanism. Neither Macmillan Publishers Limited nor any of its agents accept
liability for any statements made which are clearly the sender's own and not
expressly made on behalf of Macmillan Publishers Limited or one of its agents.
Please note that neither Macmillan Publishers Limited nor any of its agents
accept any responsibility for viruses that may be contained in this e-mail or
its attachments and it is your responsibility to scan the e-mail and 
attachments (if any). No contracts may be concluded on behalf of Macmillan 
Publishers Limited or its agents by means of e-mail communication. Macmillan 
Publishers Limited Registered in England and Wales with registered number 785998 
Registered Office Brunel Road, Houndmills, Basingstoke RG21 6XS   
********************************************************************************

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


Mime
View raw message