Why is FreeMarker used for automatic code generation?
There are many potential ways to generate code from a Statestep model in XML. Some of the alternatives include XSLT, Perl and Apache Velocity. XSLT, however, is more suitable for generating XML or HTML output than text; as well-formed XML itself, XSLT is also verbose and some people find the language constructs counter-intuitive. Perl, while powerful and concise, is intimidating to the newcomer; it’s a solution that’s much bigger than the problem. Velocity is similar to FreeMarker but lacks a standard equivalent to FreeMarker’s FMPP to load and process XML data; also, it is not powerful enough for general use. While FMPP is normally used to generate web page content, it works perfectly well as a generic template engine. Used for code generation, it strikes the right balance: simple things are reasonably simple to do while more powerful features, such as recursive macros, are available when needed.
Related Questions
- Can the rules artifacts actually be used for code generation?
- Can the rules artifacts actually be used for code generation?
- What is the Code of Management Practice and how is it used?
- Why is FreeMarker used for automatic code generation?
- What is an authorization code used for?
- What is an authorization code used for?