[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
Food for thought on subject of templates
There are two approaches to the way templates act:
1. Template is main thing - it creates/retrieves objects, calls their
methods, etc.
It has access to request and responce objects, and to the resto
environment throught them.
JSP-like, from what I understand.
2. Alternatively template could be "secondary" - i.e. there is some sort
of object, that
performs whatever it needs to, then gets hold of template, binds
data to template
variables, and then sends results to output. This is what Velocity
engine does.
I personally like second one better - it seems to force separation of
code and presentation
more. However, I'd like to hear other opinions.
--
Ilya A. Volynets-Evenbakh
Total Knowledge. CTO
http://www.total-knowledge.com