[Catmail] Making it pluggable
Jose Luis Martinez
jlmartinez-lists-catmail at capside.com
Mon Sep 15 16:01:52 BST 2008
Terence Monteiro escribió:
> 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.
Does anybody else agree on this point?
>
>> 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.
You are right. Basic plugabbility should be at first only for Actions.
But once you have that, I think people would start wanting to trigger
their plugins based on URL (and therefore, for N actions), and thats
where PluginBeforeRegex('/somepath/.*') would come in...
For the moment I think that PluginBeforeAction('/catalyst/action') and
PluginAfterAction(...) should be enough...
> 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') {
> ...
> }
>
Maybe I'll go for the approach: "first make it simple, and then later
extend it", after having a bit of experience, and feedback on the needs
of plugin authors.
Jose Luis Martinez
jlmartinez at capside.com
More information about the Catmail
mailing list