OT: Templating systems (was RE: [Catalyst] New default screen for Catalyst)

Bill Moseley moseley at hank.org
Fri Oct 21 08:59:25 CEST 2005


On Fri, Oct 21, 2005 at 12:27:52AM -0400, Perrin Harkins wrote:
> John Siracusa wrote:
> >Er, call me crazy, but I don't want my views doing selects either.  As far
> >as I'm concerned, the only think a template is allowed to do is rearrange
> >the data I pass it and synthesize values based on that data.  No selects, 
> >no
> >db access at all.  How do I enforce it?  Er, code reviews, I guess :)
> 
> What, Rose::DB::Object doesn't do lazy-loading? :) I think that's the 
> sort of select that Bill was talking about.

Not so much lazy-loading.  Rather say you have a list of workshops you
want to display along with all instructors assigned to each workshop,
and you want to show the access rights assigned to each of those
instructors.

In the controller you just fetch the workshop records and then the
template can display the related information via the magic of the
object model relationships.

I do use quite a few views with Postgresql and CDBI.  I guess that
kind of protects me from updates happening in the templates since the
views are not updatable. ;)  Doesn't protected any related classes,
though.

-- 
Bill Moseley
moseley at hank.org




More information about the Catalyst mailing list