On Wed, Jun 20, 2012 at 2:39 PM, Bill Moseley <mose...@hank.org> wrote:

>
> I'd worry less about where your database calls are happening.  Do you
> really care if [% user.address.city | html %] hits the database in the
> template or in the controller?
>
Well, not caring where this happens tends to lead to the what you describe
next.  Why not put the address data in the stash? The model knows it will
need to display it.


> One point of the object abstraction is you don't care about the
> implementation.   The real problem I've seen, though, is doing something
> stupid like huge nested loops in the template where each one generates a
> query.
>
This is what I meant to about maintenance nightmare.

I've inherited apps like this where I had to roll nested queries (in
templates) up into a single query to go from 120 round-trips to the
database, taking 8 seconds, into one round trip, taking half a second.

L.


-- 
lenja...@jaffesystems.com   614-404-4214             www.volunteerable.net
Proprietor: http://www.theycomewithcheese.com/ - An Homage to Fromage
Greenbar <http://www.greenbartraining.org/>: Grubmaster: 2012-2009, Grub
Asst: 2008, Trained: 2007.
_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk

Reply via email to