Strategy development scheme and state design template

I read this about state template. Does this look like a strategy template? What is the exact difference between these two patterns?

+3
source share
4 answers

The difference between government and strategy is intent. With the strategy, the choice of algorithm is pretty stable. Using state, changing the state of an object "context" makes it choose from its "palette" of objects "Strategy".

See http://sourcemaking.com/design_patterns/state

+3
source

. , Context , , .

. java

+1

, , :

-In State. , , : , -, .

-In . , , , , ( ) "" , .

, , , . State , .

, .

0

In a state template, usually a state action causes a state change; in the strategic scheme, the action of the strategy does not cause a change in strategy. In other words, a state change lies in the state itself; a change in strategy lies in the external state.

0
source

All Articles