The Strategy Design pattern, from the book Design patterns written by the Gang of Four, has the following statement in the Consequences section:
Strategies eliminate conditional statements. The Strategy pattern offers an alternative to conditional statements for selecting desired behavior. When different behaviors are lumped into one class, it's hard to avoid using conditional statements to select the right behavior. Encapsulating the behavior in separate Strategy classes eliminates these conditional statements.
This statement is not as black and white as it seems. The Context class is indeed relieved from the burden of conditional statements. However, in case there is a single client, that injects different Strategies in the Context, then there must be a conditional statement in the client to make the decision. This means the conditional statement is not eliminated, but moved!
However, I can come up with a scenario where this Consequence might be true. In case there are multiple clients that all need the Context with a different Strategy. Then the conditional statement is eliminated from the code base, because each client creates its respective Strategy & Context combination. Is this what is meant by 'Strategies eliminate conditional statements' in the Consequence section of the Strategy design pattern or am I missing something?