[dev] interesting article on templates

Nuno Loureiro nuno at co.sapo.pt
Wed Sep 17 08:49:32 PDT 2003


On Wed, 2003-09-17 at 04:52, Chuck Hagenbuch wrote:
> Quoting Nuno Loureiro <nuno at co.sapo.pt>:
> 
> (...)
> > - Menu::customItem()
> > - Horde::link()
> > - Horde::widget()
> 
> What *business* logic is in these?

There's no business logic in this, there's a presentation logic only.
But that doesn't mean that both logic are separated, because these are
methods of classes that constitutes the core of Horde, that belong to
the global business logic of the application. I mean, if you want to
change the layout of this you have to put your hands on the code, not on
the templates as it should be.

I needed to put this presentation logic into the templates, so the
design here could change the menu appearance. One of the problems of
having these logics mixed is that for 2 Horde installations, with
different layouts, you need to have 2 copies of Horde in the filesystem.
It should be possible to have this, having only 2 copies of the
templates, not the entire application for example.

> (...)
> > - 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?

I'm not telling about on purpose security bugs. I was trying to say that
is a lot more easier to introduce security bugs having the freedom of
PHP than with a templating system. With other department, I mean for
example, the designers team, which doesn't know PHP at all.

> > - 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.

That's not an argument about IMP, it's just a general argument. We all
know of big companies that switched from other languages to PHP for
example.

> > - 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?

Perhaps. I'm integrating IMP in a very big project of my company, that
I'll talk about in the middle of Oct. (which will be a good projection
for Horde). We're starting to use templating systems, so right now, I'm
in a good position to "define" a position about this subject. 

-- 
Nuno Loureiro <nuno at co.sapo.pt>
PTM.com - http://www.sapo.pt/
PGP fingerprint = 8A32 5174 E80C 2D40 9075 405E C107 6592 054A 4D05



More information about the dev mailing list