The main reason for doing this is to see if there is any performance improvement. Right now .. the way the templates are used is very inconvenient. Another issue is the fact that the templates are still being edited so a "one shot" conversion will not do any good. Yet another reason would the coolness factor :-).
The task is quite challenging since velocity is not a typed language and the target language is typed. The way to do it properly is to have some sort of type inferrence engine to be applied for expressions to find the most likely type for it. It actually works quite nice. Also you have issues with variable scopes because of certain usage practices of velocity macros. For example you can write something like this:
#set($var = "");
#set($var = $expression);
If you translate this to:
String var = "";
var = expression;
and expression has a different type than String you are in trouble with javac.
More next time.
No comments:
Post a Comment