What are the main differences between StringTemplate and FreeMarker?

前端 未结 2 742

The net seems to be full of comparisons between Velocity and FreeMarker, and they seem to be reasonably equivalent. But there seems to be almost no comparisons between StringTem

2条回答
  •  闹比i
    闹比i (楼主)
    2021-02-03 22:08

    The main difference is that StringTemplate strictly enforces model-view separation and you can't put logic in the templates and FreeMarker lets you put full of logic in the templates.. This at least at the beginning make it more difficult to use but it's more scalable. For example if you are generating code and you have no logic in the templates generating another port for another language is less tedious because you haven't to replicate logic in each template.

    There's a paper from Terence Parr that explains the benefits from model-view separation

提交回复
热议问题