Fendaria has asked for the wisdom of the Perl Monks concerning the following question:
Quick Summary: A new version of module isn't backward compatible. How can I incrementally upgrade pieces of a complex system that use this module?
I love Class::MethodMaker. It is used by almost every module I write (and I mean every). Unforunately the module has gone through a major interface change from v1.12 (which I use now) to v2.0x and I, of course, used lots of features which are not backward compatible. There are no technical reasons why I can't keep using the old 1.12, I just don't like using or having to install older, outdated, unsupported versions of currently available CPAN modules.
I also didn't simply use this module but inherited from it and made some nontrivial changes to how object inheritance, creation, and initialization work. This means I'm going to need to sit down and really understand how the module is working now and do some extensive functional behavior testing on it.
Once this is done, I expect it will take a week+ to get all my current scripts and modules changed over and tested. This is a week I just can't justify spending.
And of course the problem compounds itself in that any new code I write has to use the older version of the module too...so the situation keeps getting worse.
I can't come up with a good solution and need help.
I'd really like to at least be able to write any new code using the latest version of Class::MethodMaker while somehow letting the old code still work. But this would mean keeping two versions of the same module around. It would also mean, quite possibly, needing to have two versions of the same module loaded at the same time.
Is there any way I can do this? Is it possible to have two versions of the same module out there on your @INC and pick which one you use? Is it possible to actually load two different versions of the same module into your program at the same time?
Or am I looking at this problem in the wrong way? Are there any other possible solutions I've overlooked or help you can offer me? I've been struggling with this problem for a while and haven't come up with anything.
Currently I'm being forced to install the older versions of the library and do a
use Class::MethodMaker 1.12;
I know my example specifically mentions Class::MethodMaker but I've been pondering this same issue about some other modules I've written and for Perl in general. Normally Perl lets you do almost anything but it seems like this might be too much even for Perl.
And as an aside, what is going to happen when Perl6 comes out? Can you have both Perl5 and Perl6 installed on your system or will it be an all or nothing deal? All I have been able to discern so far is it is looking like Perl6 wont be compatible with Perl5.
Thanks
Update:
I realize I can install a local version to test / build with and I will be doing this for my initial work but once this is done, then what?
I have 4+ projects each using 30+ modules (many shared, some not) which almost all use this one module. The only choice seems to be update ALL the code at the same time to use the new module or update none of the code. I've been hoping there was something else besides the all or nothing solution.
I suppose this is what a CVS fork is for...but I really don't want to go that route either
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Two(+) versions of same module?
by ysth (Canon) on Apr 29, 2005 at 21:17 UTC | |
|
Re: Two(+) versions of same module?
by suaveant (Parson) on Apr 29, 2005 at 20:37 UTC | |
|
Re: Two(+) versions of same module?
by jhourcle (Prior) on Apr 29, 2005 at 20:37 UTC | |
by Fendaria (Beadle) on Apr 29, 2005 at 21:18 UTC | |
|
Re: Two(+) versions of same module?
by tilly (Archbishop) on Apr 30, 2005 at 00:14 UTC | |
|
Re: Two(+) versions of same module?
by naChoZ (Curate) on Apr 30, 2005 at 00:53 UTC | |
|
Re: Two(+) versions of same module?
by itub (Priest) on Apr 30, 2005 at 12:01 UTC |