4 ms·
Well I've done that before and the results were no better than using inheritance. What's the point?
by nradov 3y ago
Well I've done that before and the results were no better than using inheritance. What's the point?
- _a_a_a_ 3y agoI guess it's like this – implement interfaces, and common code comes with it when you inherit (then override to modify behaviour). A common interface really should have common code so this is appropriate. What is wrong is to inherit from an object with a different interface just to get your hands on the code - that might seem obvious but when OOP started to be used in industry, that was acceptable or even recommended practice. That malpractice was formalised away by Barbara Liskov with the Liskov principle. I'm pretty certain you're doing the right thing already so it was a clarification rather than a criticism.