Monday, September 8, 2014

Comparing Java Template Engines

This is more for general purpose use-case other than just for building web-apps e.g. creating HTML for EDMs.

A great guide here: http://www.slideshare.net/jreijn/comparing-templateenginesjvm

In summary:

  • If you need a designer-friendly system:
    • Thymeleaf
    • Mustache
  • If you are a stickler for the DRY (Don't Repeat Yourself) principle:
    • Jade generates HTML from scripts
  • Or if you prefer something more developer-friendly:
    • Freemarker
    • JSP listed as an option by presenter also
In my view, having something designer-friendly is why you use a temple engine in the first place. So the shortlist came down to Thymeleaf and Mustache, and Mustache wins out for simplicity and performance. Note though that Mustache may be too simple for some of your needs.

No comments:

Post a Comment