The strategy pattern lets the algorithm vary independently from the clients that use it. It is often used when you have multiple ways to achieve a task, and you want to switch between them at runtime. Use Case: The Strategy Pattern is useful in scenarios where you want to swap between ...
For instance, the problem of designing an efficient algorithm for deciding whether a given polygon tiles the plane becomes more tractable when restricted to polyominoes, that is, subsets of the square lattice Z2 whose boundary is a non-crossing closed path. Indeed, while a sufficient condition ...