Tuesday, July 31, 2007

freemarker vs velocity

There is a feature comparison sheet on Freemarker site, listing why Freemarker is a superior templating engine to Velocity. Not very objective you may say, but there are certain features, like the use of JSP tags and XML transformation capabilities that Velocity lacks. Freemarker more closely follows the MVC pattern, in that Velocity allows you to change the model from the view (e.g. request.session.removeAttribute(attrName) will remove the attribute) while Freemarker does not let you do so. I do not think that any of the two engines is a serious contender for a full blown web engine to be honest, but I would be interested to see some speed statistics, especially for uses in high volume messaging applications where every single message would need to go through the engine. Furthermore, the quest for separation of the model from the view reminds me of that other quest for over-validation. I don't want templates that change my model, sure, but I don't want to have to recompile my classes just because an email wants person.surname in addition to person.name in it, either.


Anonymous said...

Obtain and select some good points from you and it aids me to solve a problem, thanks.

- Henry