Is it worth while to allow overriding one of the core methods? I am thinking of the ability to inject a checksum algorithm into an application that hardcodes the key.

Another thought - if overriding an existing checksuming algorithm is to be avoided at all costs, how about just failing in the case of a duplicate, and recommending the plugin module apply a namespace:

package Algorithm::CheckDigits::Plugin::MyStuff; ... Algorithm::CheckDigits::plug_in( 'MyStuff::method1', 'My::Implementati +on' );
It should keep the logic simpler (die if exists...) and still allow for a mass import (as in the case of the core modules in the current implementation). The Core:: and unspecified namespace (Core::Foo and Foo) could be declared as reserved for A::CD. Enforcing that declaration is your call (sort of like not mucking around in the internal data structure of an object).

Since this is your module and my main focus is to be able to tie Algorithm::Damm into the Algorithm::CheckDigits framework, as long as that is the end result, I will defer to you, and my current holdings in round-tuits.

Note: I found a bug in my implementation where I didn't lc the key on insert. I will apply a fix for that, since it needs to happen no matter what the outcome of the plugin policy for this module ends up being. fixed.

Update: I also am concerned about the inability of being able to use the same mechanism in the core A::CD framework. It appears that this proposal would require the creation of a registry in each plugin class - at which point I might as well just subclass A::CD and be done with it, as the complexity for the user is pretty much the same. I like the simple syntax for the CheckDigits() call.

--MidLifeXis


In reply to Re^3: Plugin Overwriting or saving keys in Algorithm::CheckDigits configuration by MidLifeXis
in thread Plugin Overwriting or saving keys in Algorithm::CheckDigits configuration by MidLifeXis

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.