in reply to Recommendations for adding plugin/addon capability to a program
I've written about plugins before, the gist of which is that autoloading plugins a la Module::Pluggable is often a bad idea.
In the long run, rather than automatically scanning for all installed plugins and using them, end users will get more predictable and reliable behaviour if you force them to provide an explicit list of plugins to load. Something like:
my $person = MyApp::Person->new( name => 'Bob', age => 33, plugins => [ 'FooCorp::Employable', 'Web::Social::Contact', ], );
I've had a todo for a while that I should write a follow up to my earlier article, showing how to use roles for extensibility. Until I write that, I refer you to MooseX::Traits, and the Role::Tiny documentation to get an idea of how this can be accomplished without Moose.
|
|---|