Design Principles
Encapsulate what varies
- Identify the aspects of your application that vary and separate them from what stays the same.
Program to interfaces, not implementations
Favor composition over inheritance
Strive for loosely coupled designs between objects that interact
- Loosely coupled designs allow us to build flexible OO systems that can handle change because they minimize the interdependency between objects.
Classes should be open for extension, but closed for modification