Strategy
Updated: 03 September 2023
The strategy pattern is about using composition instead of inheritence
The strategy pattern defines a family of algorithms, encapsulates each one, and makes them interchangeable. The algorithm can vary independent of clients using it
Algorithm/implementation is decoupled from its clients
This works by creating an object which wraps the behaviour we want to implement in a family of classes, allowing clients to choose which behaviour they would like to implement by referencing the interface that these behaviours implement.