in reply to Re: Re: Three-layer web application architecture
in thread Three-layer web application architecture

. . . for me they are both similar: in-line mini-languages . . .

They are both in-line, but HTML::Template takes the view that HTML designers are not programmers, nor should they be. As such, the only control a template writer has over the output is simple conditionals, loops, and variables. Ignoring, of course, HTML::Template::Expr, which hasn't been updated for over a year, is rather inefficient, and is generally considered an evil step-brother of HTML::Template.

OTOH, TT is practically a full-fledged language of its own.

----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer

: () { :|:& };:

Note: All code is untested, unless otherwise stated

Replies are listed 'Best First'.
Re^4: Three-layer web application architecture
by adrianh (Chancellor) on Nov 17, 2003 at 15:30 UTC
    OTOH, TT is practically a full-fledged language of its own.

    A language targeted at the presentation side. Allowing the presentation folk to use a tool that's better suited to them than Perl (and can be customised to an even better fit by the addition of plugins and filters).

    But then I like domain specific languages :-)

Re: Re: Re: Re: Three-layer web application architecture
by perrin (Chancellor) on Nov 17, 2003 at 17:53 UTC
    TT is practically a full-fledged language of its own

    I consider that the downside of TT. Look at some of the awful things people do with it when they try to do complex things in the template. Apache::Template is commonly a source of great evil. However, I think the majority of users are still treating it as a simple display-oriented language.

      I've also seen people do truly awful things with HTML::Template. Because of the lack of expressive power in the templating language "view" related code migrates back into the controller/model, making it a complete pain to change the layout.

      What it comes down to (as always :-) is getting vaguely bright people to do the project who understand how to separate concerns, and then using whatever tool does the job best - be it HTML::Template, Template Toolkit or whatever.

      (I do agree about the evil people do with Apache::Template tho' :-)

      perrin sez:

      Apache::Template is commonly a source of great evil. However, I think the majority of users are still treating it as a simple display-oriented language.

      Permit me to rephrase that: Apache::Template makes it damned hard to do anything other than display data. Which means that cruft sets in as soon as one tries to do more.

      perrin's advice saved me from going down that path some time ago.