Affiliate disclosure

Book titles on this page link to Amazon. As an Amazon Associate, DataField.Dev earns from qualifying purchases — at no additional cost to you.

Further Reading: Inheritance and Polymorphism

Object-Oriented Design

  • Martin, R. C. (2017). Clean Architecture: A Craftsman's Guide to Software Structure and Design. Prentice Hall. (Tier 1) Covers SOLID principles including the Liskov Substitution Principle and the Open-Closed Principle in depth. More advanced than what we covered, but the chapter on dependency inversion connects directly to our discussion of programming to interfaces.

  • Gamma, E., Helm, R., Johnson, R., & Vlissides, J. (1994). Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley. (Tier 1) The classic "Gang of Four" book. Heavy on Java and C++ examples, but the patterns themselves are language-independent. The Template Method pattern (Section 15.3's ReportFormatter) comes directly from this book. Best used as a reference rather than read cover-to-cover.

  • Slatkin, B. (2019). Effective Python: 90 Specific Ways to Write Better Python, 2nd Edition. Addison-Wesley. (Tier 1) Items 37-43 cover inheritance, mixins, super(), and composition in Python specifically. More practical and Python-focused than the Gang of Four book. Highly recommended for understanding when and how to use these features in real Python code.

Python-Specific OOP

  • Python Documentation: abc module. (Tier 1) https://docs.python.org/3/library/abc.html The official documentation for abstract base classes. Covers ABC, ABCMeta, @abstractmethod, and registration. Essential reference when designing class hierarchies.

  • Python Documentation: Method Resolution Order (MRO). (Tier 1) https://docs.python.org/3/howto/mro.html The definitive explanation of Python's C3 linearization algorithm. Technical but thorough. Worth reading if you use multiple inheritance.

  • Ramalho, L. (2022). Fluent Python, 2nd Edition. O'Reilly. (Tier 1) Chapters 14 and 15 cover inheritance, interfaces, and protocols in Python with extraordinary depth. The discussion of "Waterfowl and ABCs" (using collections.abc) is particularly relevant to understanding how Python's standard library uses the patterns from this chapter.

The Composition vs. Inheritance Debate

  • Favor Composition Over Inheritance — Wiki.c2.com. (Tier 2) https://wiki.c2.com/?FavorCompositionOverInheritance A community-written exploration of why experienced developers lean toward composition. Features real-world examples of inheritance hierarchies that became unmaintainable. Good for understanding the why behind the guideline.

  • Bernstein, J. "Goodbye, Object Oriented Programming." (Tier 2) A widely-read essay arguing that traditional OOP inheritance creates more problems than it solves. Provocative but raises valid points about banana-gorilla-jungle problem and diamond inheritance. Good counterpoint to the textbook treatment.

For the Curious

  • Python's collections.abc module. (Tier 1) https://docs.python.org/3/library/collections.abc.html A masterclass in abstract base class design. Defines abstract interfaces like Iterable, Sequence, Mapping, and MutableMapping. Study how they use @abstractmethod and mixin methods — it's the same pattern from Section 15.6 applied at scale.

  • Liskov, B. & Wing, J. (1994). "A Behavioral Notion of Subtyping." ACM Transactions on Programming Languages and Systems. (Tier 1) The original academic paper defining the Liskov Substitution Principle. Highly technical, but the introduction is accessible and gives you a sense of the formal reasoning behind the intuitive rule from Section 15.9.

  • Hettinger, R. "Super considered super!" (PyCon 2015 talk). (Tier 2) Raymond Hettinger's talk explaining Python's super() in detail, including cooperative multiple inheritance. Available on YouTube. Entertaining and clarifies many of the subtleties around super() that this chapter introduced.