interface-vs-implementation-inheritance-distinct-roles

Status: OUT

OO design distinguishes two kinds of inheritance with fundamentally different purposes — interface inheritance enables polymorphic substitution, while implementation inheritance shares code — and conflating them causes the encapsulation-breaking problems that motivate the composition-over-inheritance principle.

Justifications

Distinguishing interface from implementation inheritance clarifies when inheritance is appropriate

Depends on (SL): class-vs-interface-inheritance-distinction, polymorphism-definition-gof, inheritance-breaks-encapsulation

Depended on by

JSON