velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Revusky <revu...@wanadoo.es>
Subject Re: The Guardian website moves to Velocity
Date Fri, 11 May 2007 16:44:14 GMT
Townson, Chris wrote:
>>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.

Sure, but that was never even the issue being discussed, was it? FM's 
functionality is a superset of Velocity's, so even without knowing what 
you were doing exactly, it was always clear you could do it with FM 
also. The issue at hand (I thought... at least one issue) was simplicity 
vs. complexity, and what I see from this is that, not only can you do it 
in FM (we already knew that) but it is not any more or less "simple". 
It's exactly the same with a delimiter or two changed. The whole "but 
Velocity is so simple" argument does not seem to stand up to much 
scrutiny, does it?

Jonathan Revusky
--
lead developer, FreeMarker project, http://freemarker.org/


> 
> C


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


Mime
View raw message