Hey Barry!

> I used to use HTML::Template for projects, but I moved to 
> Template::Toolkit because I felt the former's syntax was just too 
> limited.  I know we want to separate code and logic, but H::T 
> keeps me 
> from even referencing the attribute of an object.  You can't say
> 
> <TMPL_VAR NAME="user.name">
> 
> and pass in a user object with the attribute (method) or even 
> a hash key called name.


Of course you can do this, but not in exactly that way.

There are three tasks which have to be completed to perform the
operation you describe:

  1. Get object
  2. Get object attribute
  3. Display attribute

Imagine two lists of responsibilities: one for the programmer and one
for the HTML designer.  In the scheme you describe you've allocated the
responsibility as follows:

  Programmer: Get object
  HTML Designer: Get object attribute, Display attribute

With HTML::Template the responsibilities are exactly the same -- it's
just the allocation which is different:

  Programmer: Get object, Get object attribute
  HTML Designer: Display attribute

This is no more than a philosophical difference.  HTML::Template assumes
HTML designers should never do programming tasks, and implements this
philosophy by not opening the "code floodgate" at all.  TT believes that
there is some amount of code you want your designer to do.

TT hopes that you will limit your use of these capabilities to "simple"
things (such as retrieval of an object attribute).  Unfortunately, the
floodgate is opened and allocation of responsibility is completely
arbitrary.  TT users can (and do) allocate responsibilities like this:

  Programmer: ???
  HTML Designer: Get object, Get object attribute, Display attribute

The programmer doesn't seem to have anything to do anymore.  "That's
great," says the client, "programmers are really expensive!"  Of course,
that "HTML Designer" is not really an HTML Designer anymore:

  HTML Designer/Programmer:  Do it all.

If you have access to a lot of people who are expert designers and
programmers, that's great.  Let me know where you find them!  I've been
looking for years.  ;-)


TTYL,

-Jesse-


--

  Jesse Erlbaum
  The Erlbaum Group
  [EMAIL PROTECTED]
  Phone: 212-684-6161
  Fax: 212-684-6226



Reply via email to