[dev] interesting article on templates

Chuck Hagenbuch chuck at horde.org
Tue Sep 16 20:52:40 PDT 2003


Quoting Nuno Loureiro <nuno at co.sapo.pt>:

> I don't quite agree with you because Horde, or at least IMP, has not
> business logic completly separated from the presentation logic. In fact,
> I just realized that when converting IMP to Horde_Templates. Obviously
> an application has both logics separated when you don't need to change
> business logic to change its presentation. Some examples of problems
> about this separation in Horde/IMP are a lot of class methods that
> produces HTML, like:
> - Menu::customItem()
> - Horde::link()
> - Horde::widget()

What *business* logic is in these?

> - Notification_Listener_status::notify()

On this one you are correct. And yes, elsewhere.

> What I've tryed to do so far, and I have some new stuff done, was to do
> both things at once, i.e., -separate both logics, and -"templatatize"
> the presentation. Now I realized that this task would had been a lot
> more easier if I splitted it in 2. I should have done in first place,
> the separation between both logics, and only after its commit, proceed
> with the templatization.

I agree. It'd also be more likely to result in a clean and well thought out
solution, I think.

> - You can have a separate department or team or outsource the interface
> and you don't have several security concerns because the template
> language is rather limited, comparing with PHP.

I agree that this is an issue in some cases - as I already said, Giapeto. But if
you can't trust another department in your company, can you trust the team that
*does* touch the PHP code?

> - If later you want to change the main language of your application, the
> interface doesn't need to change at all.

As in PHP to Java or something else? I don't buy that as an argument.

> - You can do template parsers in more languages, than PHP.
> - In a company, like where I am, that lots of sites are made in perl and
> some in PHP, you can have a unique templating system and you only need
> to teach to designers a unique and simple "language".

So you use the same template syntax, in your company, that Horde_Template uses?

-chuck

--
Charles Hagenbuch, <chuck at horde.org>
Born right the first time.


More information about the dev mailing list