Musica edin torni

Program to an interface, not an implementation”. A Strategy defines a design patterns explained simply pdf of algorithms that can be used interchangeably. Modes...

Program to an interface, not an implementation”. A Strategy defines a design patterns explained simply pdf of algorithms that can be used interchangeably. Modes of transportation to an airport is an example of a Strategy.


Specify the signature for that algorithm in an interface. Bury the alternative implementation details in derived classes. Clients of the algorithm couple themselves to the interface. Strategy is like Template Method except in its granularity.

State is like Strategy except in its intent. Strategy lets you change the guts of an object.

Strategy objects often make good Flyweights. This article is taken from our book Design Patterns Explained Simply. All of the design patterns are compiled there.

admin