Skip to main content

3 docs tagged with "inheritance"

View all tags

Chapter 5: Object-Oriented Programming

Martin revisits the three pillars of OOP — encapsulation, inheritance, and polymorphism — and argues that OO's true architectural gift is safe, convenient polymorphism that enables plugin architecture and dependency inversion.

Chapter 6 — Class Design

Deep dive into Java inheritance, abstract classes, polymorphism, method overriding rules, final keyword, immutable class design, and Object methods — with focus on the subtle OCP exam traps around field hiding and initialization order.

Chapter 9: LSP — The Liskov Substitution Principle

If S is a subtype of T, objects of type S must be substitutable for objects of type T without altering the correctness of the program. LSP governs not just inheritance but any interface contract — and its violation breaks architectural boundaries.