December 2015
Beginner to intermediate
195 pages
2h 52m
English
![]()
GoF Definition: Define a family of algorithms, encapsulate each one, and make them interchangeable. The strategy pattern lets the algorithm vary independently from client to client.
We can select the behavior of an algorithm dynamically at runtime.
In a football match, at the last moment, in general, if Team A is leading Team B by a score of 1-0, instead of attacking, Team A becomes defensive. On the other hand, Team B goes for an all-out attack to score.
The above concept is applicable to a computer football game also. Or, we can think of two dedicated ...
Read now
Unlock full access