Speed ​​vs. FreeMarker

Speed ​​or FreeMarker?

Do they look almost the same, even the syntax?

What to use? Or when to use what?

+57
java template-engine freemarker velocity
Sep 22 '09 at 11:06
source share
5 answers

Velocity is no longer under active development. Freemarker.

Freemarker is also much more flexible in my experience.

+51
Sep 22 '09 at 11:08
source share
β€” -

The goals for the projects are different.

The goal of speed is to simplify templates as much as possible to help maintain the separation between logic and presentation, so you don’t slide along the slippery slope of sticking code in templates. This is sometimes correct. Of course, sometimes being able to connect complex logic directly to templates is correct.

Speed ​​often does not change, but this does not mean that it is not in active development. The user community is large, the code is fast and stable, the syntax is mostly fixed. Over the past few years, Freemarker has undergone a rollback in the template syntax and api side. Sometimes it's nice to leave one alone. Again, depends on what you are looking for.

The Freemarker documentation is much wider - and this is a much more complex piece of software.

Many of the Freemarker use cases come down to the desire for a complex template workflow and do not require a compilation step. In recent years, instead of struggling with this with Java, I just used Python or Ruby.

+50
Dec 31 '09 at 7:58
source share

Use Freemarker if you can:

  • Still in active development, as @skaffman said
  • Good documentation, better Velocity IMHO
  • Provided as an alternative template language in many web infrastructures
  • Less dependency than Velocity
  • More complete than raw speed without extensions.
  • Also see the link provided by @leonm
+20
Sep 22 '09 at 13:20
source share

They try to distinguish from time to time ( example ).

I worked a lot with both, and from my point of view, they are very similar. There are so many functions that you can embed in a template language, the rest is just fluff.

+7
Sep 22 '09 at 11:17
source share

There are two published books in Velocity:

and other books that have chapters about it. So that FreeMarker has more or better docs :).

+2
Jun 26 '10 at 16:57
source share



All Articles