Recently I have been messing around with building an enhanced benchmark suite. In order to achieve my goals I have decided to use an object oriented approach. I completed a survey of Benchmark, spent some time coming up with a reasonable object model and interface and even completed most of the coding for my new functionality. So far so good.
Originally, for compatibility and reliability reasons I had intended on using the timing routines from Benchmark in order to do most of my actual benchmarks, with my code mostly handling administrative tasks. This seemed a reasonable approach as Benchmark is part of the standard distro and therefore should be well tested and so forth. My initial analysis showed that I could simply replace one routine with my own (ie not call it but do its job, plus my own) and thus my class would just be a seperate inteface into the module with additional functionality.
Wrong.
It turns out that I overlooked a couple of minor issues and will have to modify futher aspects of Benchmarks behaviour. And to make it worse it seems that the module is not in the slightest bit object oriented. Despite the fact that there are Benchmark Objects, the internal architecture of the module is primarily procedural and therefore doesn't really allow overriding methods. To achieve what I want to do I will have to resort to messy subroutine redefinitions or take the time to convert the module to a more OO structure.
And now for the question :-)
This seems to be an issue when dealing with some of the older modules on CPAN or modules in the standard distro. Sure they are good at what they do, but occasionally you want to extend them, but often they aren't really structured to be extended and reused. So what to do? Go through the contortions of a workaround? Contact the authors and hope there is an OO version coming down the pike? Roll yer own? Rewrite the module go from there?
I'm curious as to whether this has been an issue for other Monks, and what approach you all think is reasonable.
Thanks,
Yves
--
You are not ready to use symrefs unless you already know why they are bad. -- tadmc (CLPM)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Working with Standard Modules...
by jmcnamara (Monsignor) on Sep 26, 2001 at 12:47 UTC | |
by demerphq (Chancellor) on Sep 26, 2001 at 18:06 UTC | |
|
Re: Working with Standard Modules...
by dragonchild (Archbishop) on Sep 26, 2001 at 19:08 UTC | |
by tye (Sage) on Sep 26, 2001 at 19:16 UTC | |
by demerphq (Chancellor) on Sep 29, 2001 at 06:01 UTC | |
by jeffa (Bishop) on Sep 26, 2001 at 21:57 UTC |