Over the next couple of months I hope to cover some of the common software design patterns. I’m going to cover them in the order they are written about in the book Head First Design Patterns.
Motivation
The desire to model varying implementations of the same core behaviour and to decouple this behaviour from the consuming client.
Solution
The Strategy pattern defines a family of behaviours or algorithms. Each type of algorithm is encapsulated in a separate entity. The client can consume different types of algorithm interchangeably.