Decouple an abstraction from its implementation so that the two can vary independently.
An abstraction and its implementation should be defined and extended independently from each other.
A compile-time binding between an abstraction and its implementation should be avoided so that an implementation can be selected at run-time.
Separate an abstraction from its implementation by putting them in separate class hierarchies.
Implement the Abstraction in terms of an Implementor object.
✅ Provides a flexible alternative to subclassing.
❌ Introduces an additional level of indirection.
Last updated 1 year ago