BURGHARD Éric wrote:

Injecting data is the point, but for me "looking up data from a database" is
quite like "injecting data".

Not for me. Read why below.

Just it's not from session but who cares.
Passing through flow for something that has nothing to do with logic, and
because it's not in session, just let me think that there should certainly
exist a better way.

The problem is to separate concerns. We aim to have a template language that we can give to graphic designers and therefore they will be given the page and the variables that contain the dynamic data they need to present. No other information is required for them to accomplish their task.


This is IoC at the template level and all the information on "how to populate the context" is somewhere else (at the 'controller' level).

By placing even a single <sql:query>select * from users</sql:query> in the template you are breaking this isolation because now template designers need to know the structure of the database (and they don't!), so this resorts in having two people having to maintain the same page.

So, normally, this ends up having a pipeline, one person manages the generator the other manages the transformer, but at this point, the contract between the two gets bigger than a simple template context.

--
Stefano.



Reply via email to