in reply to Re^2: Plugin Overwriting or saving keys in Algorithm::CheckDigits configuration
in thread Plugin Overwriting or saving keys in Algorithm::CheckDigits configuration

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

Replies are listed 'Best First'.
Re^4: Plugin Overwriting or saving keys in Algorithm::CheckDigits configuration
by mamawe (Sexton) on Apr 21, 2013 at 21:30 UTC

    My thoughts about overriding are in the update above your post

    I would rather try to make the interface reasonable and easy to use. Then I would keep the logic as simple as possible within the constraints of the interface

    For mass imports there could be another function, but any plugin using this should document that it could fail in some circumstances

    I suggest we'll wait a few days for opinions from the other monks and then implement a plugin structure.