3 ms·
Does OOP require inheritance?
by grey-area 4y ago
Does OOP require inheritance?
- pjmlp 4y agoKind of, it needs the ability to express polymorphism and extend concepts. Now how that is done is practice, can be done in various ways. Class inheritance, which is what many think of. Interface inheritance or conformance, which is available in many languages via traits, patterns, data classes, functors, or other names, and OS ABIs like COM. Prototype inheritance, clone a instance and monkey patch in place (like SELF) Via composition and delegation for not handled messages. Then many languages offer a combination of those approaches.