Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Plugins: any advice or docs?

by davies (Prior)
on Jan 14, 2016 at 16:08 UTC ( #1152779=perlquestion: print w/replies, xml ) Need Help??

davies has asked for the wisdom of the Perl Monks concerning the following question:

I've never touched plugins in my life, but I'm writing something at present that I think would be improved by allowing and using them. I've been looking for docs and have found little more than Coding perl a plugin system? (2002), http://perldoc.perl.org/Module/Pluggable.html (2006) and http://search.cpan.org/~pevans/Module-PluginFinder-0.04/lib/Module/PluginFinder.pm (undated). I get the impression that it's a relatively stable area, but that's only my impression.

Another impression is that plugins should NOT be used if parameters and config files would do, but that such parameters or files might well identify which plugins are needed to provide the logic for a given situation.

Are there any tutorials in this area? Are there any standard rules for when to, when NOT to, and how to write plugins and the code to call them?

Regards,

John Davies

Replies are listed 'Best First'.
Re: Plugins: any advice or docs?
by jeffa (Bishop) on Jan 14, 2016 at 19:03 UTC

    I would start with Plugin::Tiny and also take an elevated view of known plugin systems like DBI and Template (Template::Plugin). I myself would like to incorporate such a plugin system and replace my "preset" modules inside Spreadsheet::HTML. This would allow others to publish their own CPAN modules without needing to submit patches/pull requests to me. This is what i feel a plugin system is for: allowing external code to be attached to your own, to flow through your code (be it an engine or framework) without changing that codebase.

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    
        You must have missed that the OP already listed that module. Why repeat what they already knew? Offer new information, not rhetrolical questions.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1152779]
Approved by choroba
Front-paged by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2022-05-20 16:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (75 votes). Check out past polls.

    Notices?