[Canberra-pm] Q: Subclassing an object with closures

Alex Satrapa grail at goldweb.com.au
Mon Nov 15 18:20:37 PST 2010


On 16/11/2010, at 12:54 , Daniel Pittman wrote:

> Alex Satrapa <grail at goldweb.com.au> writes:
> 
>> I think I'm going to have to hand in my Perl license, I've encountered a
>> structure I don't understand and now I have no idea how to extend the class.
> 
> The goal of a bunch of that code is to make it "private", so that you can't
> fiddle with it, so it isn't a great shock that extending it is hard.

Why would someone do something so selfish in a module contributed to CPAN?

> ...is the right solution to fix the module, then submit it to the author, and
> just depend on the latest CPAN release?

Well, in an ideal world* yes. In the real world, no. I will fix the module, rendering the "class variables and methods" as actually belonging to the namespace, and suggest to the author that he shouldn't be pulling silly stunts like this.

For my immediate purposes, I'll simply override the methods as required in my subclass. I have a deadline to meet, since I write code for money rather than intellectual stimulation :)

Alex

* The "ideal world" being defined as one where time and money are not a constraint on any activity.

Alex Satrapa | web.mac.com/alexsatrapa | Ph: +61 4 0770 5332




More information about the Canberra-pm mailing list