Design Principle



Identify the aspects of your application that vary and separate them from what stays the same.

Program to an interface, not an implementation.

Favor composition over inheritance.

Strive for loosely coupled designs between objects that interact.

Classes should be open for extension, but closed for modification.

Depend upon abstractions. Do not depend upon concrete classes.

Principle of Least Knowledge - talk only to your immediate friends.
The Principle of Least Knowledge guides us to reduce the interactions between objects to just a few close friends.

A class should have only one reason to change.