Strategy Pattern


The definition of the strategy pattern is:

The Strategy Pattern defines a family of algorithms, 
encapsulates each one, and makes them interchangeable. 
Strategy lets the algorithm vary independently from clients that use it.

What are algorithms here?

"Identify the aspects of theĀ application 
that vary and separate them from what stays the same."

Those aspects are the algorithms which can be encapsulated and make interchangeable, and it lets those varying aspects to vary independently from the client which uses those.

Continue reading

Advertisements