Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Re: Re: Inheritance vs Delegation: pros and cons

by hakkr (Chaplain)
on Jul 28, 2003 at 15:58 UTC ( [id://278471]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Inheritance vs Delegation: pros and cons
in thread Inheritance vs Delegation: pros and cons

I usually judge when it is becoming evil by the amount of method overridiing that has to be done. If you find yourself overridding nearly every method with functionality that is completely different to the parent then you are in an evil place. If however your method overriding is mainly introducing a bit of polymorphism and extending methods to handle extended structures in your object then I think you are in a good place.

Thats just a personal metric based on lazyness. I agree multiple inheritance is good and a nice way to package together your clasess.

not too sure bout delegation will need to check that oot sounds like it's just run time method dispatch

  • Comment on Re: Re: Re: Inheritance vs Delegation: pros and cons

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://278471]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2024-04-19 14:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found