sw-design  

[sw-design] Re: two alternate approaches to mixin functionality

Mark Stosberg
Sun, 05 Dec 2004 17:01:30 -0800

On 2004-12-05, Terrence Brannon <[EMAIL PROTECTED]> wrote:
>
>
> NAME
>     Class::MixinFactory::alternatives - approaches to the same functionality
>
> DESCRIPTION
>     A recent contribution to CPAN is Class::MixinFactory by Simon Cavaletto.
>     Here we show two more ways to do the same thing in addition to the ones
>     that Simon lists in the SEE ALSO section.

What thoughts do people have on the solution that uses standard export
techniques without extra modules?  This is what CGI::Application Plugins do
now.

What to mixin a CGI::Application plug-in? 

 use CGI::Application::Plugin::ValidateRM (qw/check_rm/);

That's it. It's mostly a standard 'has-a' relationship. 

The only thing slightly unique going on is that the imported

functions expect the first argument to be a CGI::Application compatible
object. 

You can mix-in these methods and then have them later inherited, or just
use them directly in the children.

So far I've seen that's very clear to the CGI::App users and the plug-in
writers how to use the system, because nothing really unfamiliar is
happening.

We have about half a dozen plug-ins using the system so far and haven't
run into any real snags that I've noticed.

    Mark

-- 
http://mark.stosberg.com/ 


_______________________________________________
sw-design mailing list
[EMAIL PROTECTED]
http://metaperl.com/cgi-bin/mailman/listinfo/sw-design