A Summary of Object-Oriented Principles

In the course of the discussion on design patterns, I have stated a number of the principles of the object-oriented paradigm. These principles can be summarized as follows:

  • Objects are things with well-defined responsibilities.

  • Objects are responsible for themselves.

  • Encapsulation means any kind of hiding

    - Data-hiding

    - Class hiding (behind an abstract class or interface)

    - Implementation hiding

  • Abstract out variations in behavior and data with commonality/variability analysis.

  • Design to interfaces.

  • Think of inheritance as a method of conceptualizing variation, not for making special cases of existing objects.

  • Keep variations in a class decoupled from other variations in the class.

  • Strive for loose coupling.

  • Strive ...

Get Design Patterns Explained: A New Perspective on Object-Oriented Design 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.