RSS 2.0 New Entries Syndication Feed Atom 0.3 New Entries Syndication Feed

Show blog menu v



Use it



Sibling projects

RIFE powered

Valid XHTML 1.0 Transitional

Valid CSS!

Blogs : Archives

< RIFE 1.6.1 released   Clustered Drupal through Quercus, Terracotta and Ehcache >
Frank Sommers : What Do You Look For in a Template Engine?

Frank Sommers of Artima has started a discussion about template engines and asks what you find important in them.

Template engines seem to be one of the most stagnant technologies in Java, many adopt the design that mixes content and logic but implement it differently (PHP, JSP, Velocity, Freemarker, ...). It's a good thing that Terrence Parr (of ANTLR fame) created StringTemplate which seems to move in a similar direction as what we've been doing with our template engine in RIFE. He acknowledges the push model that injects values and text into a template instance instead of pulling them in with an expression language. While I prefer our approach where there really is no logic in the template at all, I really appreciates what Terrence says in his docs:

Language theory supports my premise that even a minimal StringTemplate engine with only these features is very powerful--such an engine can generate the context-free languages (see Enforcing Strict Model-View Separation in Template Engines); e.g., most programming languages are context-free as are any XML pages whose form can be expressed with a DTD.

This goes back to a less-is-more philosophy where you build what is needed to comfortably use a technology in trivial and advanced situations, and nothing more. RIFE's template engine does the same. Instead of including a whole collection of additional features, we rely on you making a mental shift to adapt your development habits towards the new capabilities and characteristics of our template engine. In my case its not language theory, but rather lots of very complex HTML layouts and other uses of our template engine that gets me to say that our template engine is powerful enough to allow you to comfortably build anything you want, without compromising on context separation and reusability.

Have you ever tried out another template engine besides the classic pull model in anger? What did you think of it?

posted by Geert Bevin in RIFE on Jul 21, 2007 10:41 AM : 0 comments [permalink]


Add a new comment

Comments on this blog entry have been closed.

< RIFE 1.6.1 released   Clustered Drupal through Quercus, Terracotta and Ehcache >
Google web