[Templates] Template Tookit Vs HTML::Template

Perrin Harkins perrin@elem.com
Wed, 20 Nov 2002 12:10:56 -0500


Andy Wardley wrote:

> When I said "Most people don't seem to understand MVC..." I should have
> added "...present company excepted, of course"  :-)


I didn't mean to sound defensive about it.  I'm just fishing for ideas 
of how to explain what I want to people.

> What annoys me is when I hear that TT can't be used to build MVC systems
> because it allows objects in the code, subroutine callbacks, embedded
> Perl code (which is disabled by default) and so on.  This is pure nonsense
> written by people who clearly don't understand MVC, TT, or both.


Yes, that's crazy talk.  There's no rule that the view can't be 
implemented in 100% assembly language if that's what the project requires.

I've recently been working with a Java MVC framework from IBM.  It has 
loads of Java code in the page templates, and makes calls to (read-only) 
EJBs from them.  It does have separation, but the page templates are so 
ugly that I question whether any HTML coder will be able to deal with 
them.  To me it looks horribly inefficient because rather than pass data 
to the view it forces the view to load all the data again (using those 
EJBs), but they are very proud of themselves because they claim this 
makes it more MVC.

> I've seen at least one cleanly written and well abstracted system written
> in Embperl


I believe it.  My main reason for using a system like TT is easy editing 
by HTML coders, not separation.  The other advantage of using a more 
limited system is that the people who don't quite get it are less likely 
to screw it up.  I've had a hard time explaining to HTML coders why I 
don't want them to do a ton of IFs and string comparisons in templates 
to determine things that I could calculate in Perl code.

- Perrin