In a dynamic language - inheritance is primarily used to share code - not so much for isa type stuff. Of course here delegation is simpler to implement. The rigidity of interfaces doesn't really exist - you need only implement as much interface as your client requires...I do notice that I use inheritance much less in the dynamic languages than in the static ones. Inheritance is practically the only tool you have in java. Delegation is a pain to implement if the interface is very large at all because you have to write the forwarding messages all yourself.

I think you hit the nail on the head here. Inheritance should be about code sharing, but in a static language it's also how polymorphism is implemented. That overloading of inheritance makes it more difficult to for a beginner to design classes properly. I think the trick in Java is to stick with interfaces for polymorphism and use inheritance only for code sharing.

Plus, its trivial to put an object in between and forward the messages to different objects. ie you can do something like...

It's interesting how the next big thing in Java is AOP while along you could do the same thing in Smalltalk with "doesNotUnderstand".

Regards,
John