Andromda developers,

It came to my attention a little while ago that Sebastian Glita submitted a patch for FreeMarker support and this was rejected. Now, it's your project, and you can do what you want, but I think it is perfectly proper for me to write you a note explaining why, in my opinion, your rejection of the patch was mistaken.

AFAICS, the rejection of the patch was not based on a duly dilligent appraisal of what FreeMarker brings to the table. Rather, it seemed to be based on the idea that FreeMarker and Velocity are broadly similar in capabilities, and that having support for both would simply be superfluous.

That is not the case. FreeMarker is a much more powerful tool than Velocity. You could consult http://freemarker.org/fmVsVel.html to get a (admittedly biased) rundown of the major differences.

In your application space, my guess would be that there are 2 key aspects that you would really want to look at:

1. FreeMarker has far more powerful macro capabilities

2. Unlike Velocity, FreeMarker has support for namespace, and thus modularization, and scales up to building arbitrarily large systems.

As regards point 1, consider:

http://freemarker.org/docs/dgui_misc_userdefdir.html

FreeMarker macros can have associated blocks (coroutines or closures actually for people familiar with languages that have them) and this allows a level of flexibility via recursion that does not exist in Velocity.

Look in particular at the "Nested Content" subsection in the page linked above.

Of course, aside from this, velocimacros are extremely limited in their capabilities, since there is no ability to declare local variables. Also, the parameters passed to a macro are passed as strings, that are reparsed and re-evaluated every time they occur in the macro's body. Aside from making heavy use of velocimacros quite inefficient under many circumstnaces, it also makes it very hard to implement all sorts of recursive things in a Velocity template.

People are constantly complaining about the kinds of limitations this imposes, just all the hoops they have to go through to output a tree, say, using VTL. FreeMarker's template language has no such limitations.

As regards point 2, Velocity has severe problems in this regard due to the lack of any notion of namespaces. For example, if you have two general-purpose macro libraries written by different people, you are always exposed to the potential problem of name clashes in macro names and variable names.

FreeMarker solves this problem via the the notion of namespaces. See:

http://freemarker.org//dgui_misc_namespace.html

The above 2 points, I think, should give you an idea of why Sebastian was willing to put significant work into being able to use FreeMarker instead of Velocity.

Now, in general, from your POV, I think it's a mistake for another reason to be too wedded to Velocity. The fact is that Velocity is basically a dead project. So, not only does it suffer from the limitations I describe above, but it is likely that it always will, since there is no ongoing development taking place. This may not bother you, if you think that Velocity meets all your current needs. However, I would suggest that it makes sense to give your users the option of using a tool that is more actively maintained and supported. What this means is that if a user runs into a problem or limitation of FreeMarker, he can take it up with us and we will likely work to overcome it. That is simply not the case with Velocity, due to the extremely dormant state of the project. I do not know when the last time someone filed a bug report or feature request against Velocity and any action was taken.

I'll close this message here. Sorry for writing such a long note. I was too pressed for time to write a shorter one.

Regards,

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




------------------------------------------------------- This SF.net email is sponsored by: VM Ware With VMware you can run multiple operating systems on a single machine. WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the same time. Free trial click here: http://www.vmware.com/wl/offer/345/0 _______________________________________________ Andromda-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/andromda-devel

Reply via email to