Principles of Object Oriented Design

DRAFT

Some of the following are self-explanatory. Others require some explanation.

  1. Encapsulate what varies. Restrict outside access to the details of routines that might need to change with changing requirements.
  2. Program to interfaces not implementations.
  3. Prefer composition over inheritance.
  4. Strive for loosely coupled designs among objects that interact.
  5. Only talk to your friends.
  6. Don't call us; we'll call you.
  7. Depend on abstractions not on concrete classes.
  8. Keep classes open to extension and closed to modification.
  9. A class should have only one reason to change.

Those fit into SOLID principles:

Then there are the

See also