Heads Up Design Patterns book exercises.
Defines a family of algorithms, encapsulates each one, and makes them interchangeable. Strategy lets the algorithm vary independently from clients that use it.
Defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically
- Abstraction
- Encapsulation
- Polymorphism
- Inheritance
- Encapsulate what varies.
- Favor composition over inheritance.
- Program to interfaces, not implementations.
- Strive for loosely coupled designs between objects that interact.
- Classes should be open for extension, but closed for modification