# from Paul LeoNerd Evans
# on Tuesday 27 May 2008:
>I have a base class which is abstract, and various concrete
>implementations of it that might be chosen in different circumstances
>(different OSes, different modules installed). ...
> a: Each module just gives a ranking number, ...
> b: Each module declares a list of other modules it knows it's better
> than...
> ...
> return ( sort { $ranking{$b} <=> $ranking{$a} } @modules )[0]
>
>This works, provided every module author plays the same way with
> regard to rankings.
How does the module author know what you want for a given task,
circumstance, toolchain, or whatever other conditions? Even assuming
that one author could get the answer right, how are $n authors going to
collaboratively deliver something which assembles into the right answer
without some nudging from your code?
Seems like you might want to pick a failsafe module, then add conditions
which would allow for more optimization or other features. You might
have to take changing versions into account, but at least you won't be
trying to debug a snowflake/blizzard of changing dependencies.
That is, containing the decision into a single tarball should prove more
robust than attempting to get $n other tarballs to add a collaborative
variable.
I suppose if you end up with some conditions which could prove useful to
others, you could roll them into a distribution(s) which may or may not
resemble a bundle. The tricky bit would be to determine what can be
installed without simply trying (and possibly failing) $n
distributions, but I guess your build code could look to see what
survived and then dynamically compose its module out of that
information (this assumes that CPAN/CPANPLUS will still attempt
the 'Build' step even if installing any or all of the dependencies
fails.)
--Eric
--
[...proprietary software is better than gpl because...] "There is value
in having somebody you can write checks to, and they fix bugs."
--Mike McNamara (president of a commercial software company)
---------------------------------------------------
http://scratchcomputing.com
---------------------------------------------------