Now, we will now get to know the Strategy Design Pattern.
The Strategy Design Pattern seems to be the simplest of all design patterns, yet it provides great flexibility to your code. This pattern is used almost everywhere, even in conjunction with the other design patterns. The Strategy Design Pattern defines a family of algorithms, encapsulating each one, and making them interchangeable. Strategy lets the algorithm vary independently from the clients that use it.
Via a real life example, you will learn how and when the Strategy design pattern should be used and how to structure your code in order to implement it. You will see how it can lead to elegant solutions to code problems.