in reply to Decorator(?) classes and inheritance
The actual problem is I have a baseclass A and two children B and C, each overriding a different method in A. How do I have D inherit from B and C and have both overriden methods without having D know about the innards of A, B, and C?
Um .... you don't. As you've framed it, it seems that D needs to know that B and C have overridden different methods and that it wants both. One way to get D to do what you want is for D to define those methods itself and call the appropriate ancestor:
# Say B overrode method foo() and C overrode method bar() package D; sub foo { &B::foo } sub bar { &C::bar }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Decorator(?) classes and inheritance
by dragonchild (Archbishop) on Jan 30, 2004 at 16:50 UTC | |
by stvn (Monsignor) on Jan 31, 2004 at 02:54 UTC |