in reply to Re: Inheritance vs Delegation: pros and cons
in thread Inheritance vs Delegation: pros and cons
Ideally, I'd like to be able to get an object that has the Express interface, the Caching functionality, and the SOAPProxy implementation, but if they're all just simple subclasses of Net::LDAP, it's awkward to assemble such a beast. (Cf. "diamond pattern".) Perhaps you could accomplish it using mixin classes, but still, ick.
While I agree that is is "ick" in Perl (and Java, and many other languages) and decorators are an excellent solution, this is more a language issue than an issue with multiple inheritance in general. In Eiffel, for example, it's very easy since you have a lot of explicit control over how multiple inheritance occurs.
|
|---|