in reply to Re: Stacking Mixin Classes at Run-time with Class::MixinFactory
in thread Stacking Mixin Classes at Run-time with Class::MixinFactory
Seriously, can you justify a real world example where this cannot be replaced with a simpler concept?
Of course multiple inheritance CAN be replaced by decomposition and delegation -- for that matter you could do it all without method calls, or in COBOL -- the question is whether your code would end up being better as a result.
My contention is that controlled use of multiple inheritance is a reasonable technique for a developer to use, and more specifically that this implementation is a workable solution for cases where you'd like to extend an object through subclassing, and need the ability to use several subclasses at once.
The example I was using was from the real world -- Text::MicroMason. Using stackable mixins lets users select which features they want to enable, with relatively little overhead... If you see a better way to handle this, patches would be welcome.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Stacking Mixin Classes at Run-time with Class::MixinFactory
by Anonymous Monk on Nov 16, 2004 at 20:55 UTC |