[Catmail] Making it pluggable

Matt S Trout dbix-class at trout.me.uk
Wed Sep 24 16:11:40 BST 2008

On Fri, Sep 12, 2008 at 01:52:50PM +0530, Terence Monteiro wrote:
> Hi,
> Jose Luis Martinez wrote:
> >     Pluggability should be built into catmail. I think that a pluggable
> > app should have pluggability as a core feature, and not just a set of
> > callbacks, or points where plugins should be called, because the
> > developers will never get right where people want to plug in or change
> > the default behaviour.
> I agree.
> > It looks like Local, RegEx and other plugin actions would have to be
> > developed for completeness. So you would have PluginBeforeLocal,
> > PluginAfterRegEx, etc. Maybe the Cat ones could somehow be used so the
> > pluggability plugin would not have to maintain separate versions.
> Since a pluggability module will only need to identify uniquely which
> action it wants to be called before or after, I think it may not be
> necessary to provide PluginBeforeLocal and so forth. $c->forward requires
> no identification of the type of action to which you are forwarding. So
> calling the correct action should not be a problem.
> I'm not sure I understand what you mean here. Does PluginBeforeLocal mean
> the plugged in action is itself a Local action? If so, consider the
> following syntax:
>   sub do_something : Local PluginBefore('/an/action') {
>     ...
>   }

Why can't we just use Moose and MooseX::Object::Pluggable ?

before do_something => sub {

      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/

More information about the Catmail mailing list