On Thu, 21 Jun 2001, Ian Brayshaw wrote:
> >XSLT-like conversion of XML is just one of the things you can do with TT.
> >
> >It's a lot harder, for example, to call Perl code from XSLT, or insert the
> >results of a database query, and so on.  TT sits above XML, SQL, Perl,
> >etc., whereas XSLT just sits above XML.

XSLT can also be very slow due to its complexity when instead you could
use a skeleton template with fast simple population via perl.

> I guess that's why I'm not a TT fan: I don't consider it to be the role of
> the template/presentation layer to call the programming/logic layer. It ends
> up being another layer of programming on top of programming.

What else will the template/presentation layer do? it has to communicate
with the lower layers or its just static - using mickey mouse programming
doesn't make it any less programming.

If you use TT as a pure templating system withou plugins or embedded perl
then that is a good example of abstraction, particularly as TT hides the
implementation allowing you to call object methods as though they were
simple values.

However a pure templating system will eventually run against problems as
it can't solve every problem, many problems can be fixed far more legently
with minimal extras, such as a simple plugin or simple programming. the
alternitive would be a slow and convoluted system.

> TT as a programming tool is OK. You can write some pretty cool programs with
> it. But that's a different kettle of fish to presentation, and is perhaps
> better done in native Perl.

I've written several programs using TT, and found it to be the quickest,
most elegant soultion in each occasion. I don't think presentation should
be in the middle of your code as you appear to suggest.

using stuff like CGI.pm to output html limits the portability of code
between technical and production (ie perl and html people). TT (and any
decent templating system, even mediasurface at a push) allows clear
seperation of logic and presentation. Using something Like XSLT isn't a
great advantage over a well implemented templating system and has many
drawbacks.

A.

-- 
<A HREF = "http://termisoc.org/~betty";> Betty @ termisoc.org </A>
"As a youngster Fred fought sea battles on the village pond using a
complex system of signals he devised that was later adopted by the Royal
Navy. " (this email has nothing to do with any organisation except me)




Reply via email to