Template Systems

It is a very common need in software development to generate output which mixes pre-defined “boilerplate” content with parts which are generated dynamically. There are plenty of ways to address this need – one of them is to use a “template system”. A Typical use of a template system consists of the following components:

a collection of “templates”, each of which is a prototype output document containing some kind of tokens or expressions to indicate where (and what) dynamic data to insert.

  • some way of finding or generating the dynamic values to be merged with a template
  • some way of indicating which template(s) to use n which situations
  • a “template engine” which brings the other parts together – loading an appropriate template and merging it with supplied dynamic data to produce an output document.
Despite this, template systems vary enormously. They have different ways of storing and finding templates. different ways of indicating where and what to substitute in templates, different ways of  supplying values to be substituted, different ways of initiating the substitution,, different ways of determining the end result and so on.
Testing Template Systems

Leave a Reply