Re:The Brittleness Of Type Hierarchies
by colomon on Tuesday May 08, 2012 @12:25PM
(#3944410)
The problem is you really want to inherit the implementations as well -- otherwise every one of the classes that use the Isin interface must implement its storage and accessors as well.
[ Parent
| on HN ]
You can just do both, though. Use interfaces for polymorphism, to define the interactions between your objects -- and then, if you want, use inheritance as one possible strategy for code reuse.
That works great if you're only using one interface in your class. What if you need to include two?