The strategy pattern is a behavioral pattern which enables you to choose an algorithm at runtime.
Like the state pattern, the strategy enables you to refactor a long switch case statements.
According to this pattern, we can create strategies as objects and a complex object whose behavior
varies depending on the chosen strategy.
The strategy object changes the executing algorithm of the context object.
Some of the drawbacks for this pattern are the fact that the client needs to know the strategies beforehand,
in contrast to the state pattern where the client does not have to choose that object state.
Also, it adds a bit of overhead because of the size that the cold may take.
The problem is that if you have multiple strategies, you will have automatically a lot of classes in
your code making it harder to maintain.
Let's have a look at the implementation for this pattern in the code.