3 ms·
Inheritance of classes with behaviours has only ever brought me pain and suffering. Though sometimes I'll have an inheritance tree of interfaces, which is pret
by gitgud 6y ago
Inheritance of classes with behaviours has only ever brought me pain and suffering.
Though sometimes I'll have an inheritance tree of interfaces, which is pretty easy to manage.
The best way I've found to share behaviour is dependency injection, it's more flexible and consistent than shared methods in a parent class. But you need a DI framework to manage all the instantiation, which can add undesired complexity.