[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Plugins feature for yaird.



On Sat, Nov 12, 2005 at 11:55:37AM +0100, Marco Amadori wrote:
> I would like to know how do you feel in splitting Plan.pm's trySomething() 
> functions in separate files putted in a directory 
> like ./perl/plugins/trySomething.pm and then scan it from Plan.pm.
> Also Test suite should be splitted, maybe a little redesign is involved.
> 
> This way will be simpler for us to add features in yaird without touching the 
> main code and plugins could be also provided by external packages like evms 
> did with initrd-tools. So, e.g., dmraid's yaird code would be in the dmraid 
> package without tainting your code.
> 
> What you think about it? 

Clearly, Plan.pm is becoming bigger than desirable.  However, doing a plugin
architecture right is tricky.  The easy part is to have a directory full
of fragments of perl code and invoking them.  The hard part is agreeing
on what those fragments should do and what library routines they can
rely upon.

As an example, it would be easy to invoke the dmraid code, but hard
to make that dmraid code survive the transition from getOutput() to
runCmd().  Given the limited number of plugins, I doubt whether effort
in that direction would pay off; more effective cooperation through 
visible repositories is moe promissing I expect.

As regards test software: yep, it's ugly and we could do better.
A classical perl test suite would be difficult to do: not much to be said about
expected outcome.  Perhaps just a bunch of perl modules outside the main body
of code?

Repository remark addressed separately.

Regards,
Erik



Reply to: