Separate what changes from what stays the same
- identify the parts that vary
- encapsulate them
- later you can change the parts that vary without affecting those that don’t
This is a simple concept but it forms the basis for almost every design pattern. All patterns provide a way to let some parts of the system vary independently of all other parts.
Program to an interface, not an implementation
Source: Head First Design Patterns (2020)