[Catalyst] C::M::{CDBI,DBIC} vs direct Loader use?

Matt S Trout dbix-class at trout.me.uk
Sat Nov 19 03:11:53 CET 2005


On Wed, Nov 16, 2005 at 08:35:11PM -0600, Brandon Black wrote:
> > Yeah. Bear in mind that this works -
> >
> > $c->stash->{foo} = sub { "Foo to you, $_[0]"; };
> >
> > [% foo('Dr. Roberts'); %] # will add "Foo to you, Dr. Roberts" to the output
> >
> 
> That's about the closest to clean now that I've seen so far that
> actually works.  But I'll have to remember to wrap all of my date
> variables used in templates ( [% timezone_ize(some_date_variable) %]
> ).  I'd still really like to just make it automagic for all DateTime
> objects, but doing context-related magic on certain types of objects
> before they are Viewed without using Singleton is proving to be quite
> a pain.

This smells of insufficiently flexible ORM. But as Perrin notes any good
solution needs to not make your model classes Catalyst-specific - maybe
allowing an optional context object and falling back to something else if
it isn't available.

If you can think of a sane API for it, an RFC to the DBIx::Class list would
be much appreciated.

-- 
     Matt S Trout       Specialists in Perl consulting, web development, and
  Technical Director    UNIX/Linux systems architecture and automation. Mail
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

 + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Catalyst mailing list