[Catalyst] Caching problem?

Matt S Trout dbix-class at trout.me.uk
Fri Jan 13 23:45:52 CET 2006


On Fri, Jan 13, 2006 at 03:25:00PM -0600, Brandon Black wrote:
> On 1/13/06, Matt S Trout <dbix-class at trout.me.uk> wrote:
> > On Fri, Jan 13, 2006 at 11:19:52AM -0600, Brandon Black wrote:
> > > On 1/13/06, Matt S Trout <dbix-class at trout.me.uk> wrote:
> > > > Right, that's the lines I was thinking along - does anybody fancy doing up
> > > > a patch for this? It's not likely to get to the top of my to-do list amazingly
> > > > soon, I'm afraid.
> > > >
> > >
> > > I could take a stab at it.  I'm assuming the general idea should be an
> > > optional new C::P::Base class which creates the plugin_for accessor
> > > for those that want to inherit and use it, and then mod the plugin
> > > loader code to look for it when loading plugins.
> >
> > Shouldn't even need that - you can check the existence of plugin_for using
> > ->can then it'd just be a matter (for your example) of adding
> >
> > sub plugin_for { 'Response' }
> >
> 
> Attached is a draft of a patch against trunk.  It generalizes the
> concept for plugging into any component (Request, Response, Engine,
> Dispatcher, etc, although I can't think of how or why people would use
> the last two yet) using plugin_for as above.  Also added a section to
> C::Manual::WritingPlugins with an example for plugging into Response.

I don't think that's going to do what you think it's going to do. What you
want to do is if (e.g.) plugins are found for Response, auto-create
MyApp::Response isa <responseplugin>, Catalyst::Response and set the
appropriate foo_class to MyApp::Foo. I'm pretty sure what you're currently
doing will add stuff to either Catalyst::Request/Response itself and/or
get an empty class from the foo_class accessor and add stuff to MyApp.

-- 
     Matt S Trout       Offering custom development, consultancy and support
  Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
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