[Web-SIG] Standardized template API

Michael Bayer mike_mp at zzzcomputing.com
Tue Jan 31 23:43:24 CET 2006

Clark C. Evans wrote:
> I'd stick with the notion of a "template_name" that is neither the
> template file nor the template body.  Then you'd want a template factory
> method that takes the name and produces the template body (complied if
> necessary).  This needs to be once indirect since a template may refer
> to other sub-templates. This way your template could be stored
> in-memory, on-disk, or in a database, or even remotely using an HTTP
> cashe.  The actual storage mechanism for the template source code should
> not be part of this interface.

i agree with this totally; you definitely need to have some layer of
indirection between a template identifier and the template object itself
that is more abstract than a file location or otherwise.  just a "string"
is all it needs to be.  in the case of myghty, there is an entire list of
resolution rules that can choose to serve the actual template, each of
which can use whatever datasource it wants; file locations, URLs,
in-memory identifiers, database schemes are all fair game.

- mike

More information about the Web-SIG mailing list