[cgiapp] Re: Peer review request: weak reference patch for CGI::Application::Plugin::HTDot

Rhesa Rozendaal perl at rhesa.com
Sat Jun 21 16:36:01 EDT 2008


Mark Stosberg wrote:
> Rhesa: Since you've used it for quite some time how, how have you liked
> it? 


We've been using it in production for over two years now, and it works well. 
It does what we need just fine, and that's accessing nested data structures or 
nested objects.


It's certainly the slowest option available. That hasn't hurt us sofar, and 
we've had some high-profile events (during the Miss Universe competition we 
had about 40 million hits per day). On the other hand, we're getting so big 
that I'm now looking into the faster options (TT2, Template::Alloy), because 
shaving 50ms off every request adds up.


My biggest gripe with its functionality is that it's tricky to use one param 
value as argument to a method call on another param. Here's what I mean:

$t->param(
    an_object   => $an_object,
    a_formatter => $a_formatter,
);

with this in the template:

     <tmpl_var a_formatter.format_fancy(an_object.some_value)>

That only works if you also have something in the template referencing 
"an_object.some_value" directly, for example:

     <tmpl_if an_object.some_value></tmpl_if>

Otherwise the thing isn't recognised as a variable, because it doesn't appear 
in HTML::Template's param_map.

I've been experimenting with adding a filter to add those empty tmpl_if 
blocks. That seems the wrong approach, but it's the only thing I could think 
of other than changing big parts of HTML::Template. I'd rather defect than do 
that :-)


Rhesa




More information about the cgiapp mailing list