Perrin Harkins <[EMAIL PROTECTED]> writes:

> However, I generally don't like that sort of "callback" programming
> style.  I used to do everything that way (years ago, in an ugly
> Java-based templating system), but these days I think that doing all
> the data fetching and decision-making up front is a better approach.

How is it possible to set up all data before callign the template?

How can you know what data the template needs?


I almost only just passes in objects and general functions to the
template and lets the template call these functions and methods to get
the desired data.



I am thinking that you would have to have a special function for each
template with dynamic content.  And you would have to constantly
change that function then the template wants to display anything
diffrently.  If that is the case, it seems to be more work, doing
changes in two places.

With callbacks, you can have general functions and can create lots of
varied templats without any customized code.


I'm using the same data for all templates and the templates can chose
wich parts to use.



I don't know, but maby it's more CPU efficient to have a specialized
function for each template, but callbaxks seems to be more flexible,
powerful, easy and clean.


-- 
/ Jonas  -  http://jonas.liljegren.org/myself/en/index.html


Reply via email to