11. Avoiding Dependencies and Highly Coupled Classes

As presented in Chapter 1, “Introduction to Object-Oriented Concepts,” the traditional criteria of classical object-oriented programming are encapsulation, inheritance, and polymorphism. Theoretically, to consider a programming language as an object-oriented language, it must follow these three principles. In addition, as also covered in Chapter 1, I like to include composition.

Thus, when I teach object-oriented programming, my list of fundamental concepts looks like this:

  • Encapsulation

  • Inheritance

  • Polymorphism

  • Composition

Tip

Perhaps I should add interfaces to this list, but I have always considered interfaces to be a specific type of inheritance.

Adding composition to this list is ...

Get The Object-Oriented Thought Process, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.