[Catalyst] Catalyst performance - controller vs TT

Kieren Diment diment at gmail.com
Thu Jan 12 01:55:37 CET 2006


My approach:

We've got authentication and authorization.

A logged in user can see edit/delete/create and see their username.  An
anonymous user can't see those actions, and gets an anon user message
instead of username.

Authentication definitions and authorization roles belong in code.
The model puts together the data in the page, sends it to the view which
then provides the template and it's access to data structures.

The point of templates is that there is need to read code to edit the
display.  However the templates sometimes need to evaluate a conditional .
This leads to something like this:

[%
    INCLUDE header ;
    IF user;
    INCLUDE user;
    ELSE INCLUDE anon;
    END;
 %]

That's what I think, anyway.

On 12/01/06, Will Smith <willbelair at yahoo.com> wrote:
>
> Thanks Toby and Brandon,
> I've got the right direction now. Cause in myapp, there are too many check
> points, so I need to do that either on the TT view or in the Controller - if
> it does not really matter where to put the function. For cleanliness, and
> correctness, for sure I will follow the M-V-C model.
>
> Thanks again for the answers
>
> *Toby Corkindale <tjc at wintrmute.net>* wrote:
>
> On Wed, Jan 11, 2006 at 07:28:57AM -0800, Will Smith wrote:
> > Hi, I have a question about the performance of Cat app. For the same
> > function, like retrieve_all , should I put it in the controller or on
> the
> > template? Which one will be faster?
>
> A few things to clarify first - When you talk about templates, which View
> module are you using - TT?
>
> Are you actually asking whether it is quicker to run *any* given function
> from
> TT or Perl, or can you narrow it down to just Model-object-related data
> functions?
>
> tjc
>
> --
> Turning and turning in the widening gyre/The falcon cannot hear the
> falconer;
> Things fall apart, the centre cannot hold/Mere anarchy is loosed upon the
> world
> (gpg --keyserver www.co.uk.pgp.net --recv-key B1CCF88E)
>
> _______________________________________________
> Catalyst mailing list
> Catalyst at lists.rawmode.org
> http://lists.rawmode.org/mailman/listinfo/catalyst
>
>
> ------------------------------
> Yahoo! Photos – Showcase holiday pictures in hardcover
> Photo Books<http://us.rd.yahoo.com/mail_us/taglines/photobooks/*http://pa.yahoo.com/*http://us.rd.yahoo.com/mail_us/taglines/photos/evt=38088/*http://pg.photos.yahoo.com/ph//page?.file=photobook_splash.html>.
> You design it and we'll bind it!
>
>
> _______________________________________________
> Catalyst mailing list
> Catalyst at lists.rawmode.org
> http://lists.rawmode.org/mailman/listinfo/catalyst
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20060112/6aaf8686/attachment-0001.htm


More information about the Catalyst mailing list