Talk:Strategy

From CSSEMediaWiki
Revision as of 23:08, 11 September 2008 by Jason Clutterbuck (Talk | contribs)
Jump to: navigation, search

I'm still not quite sure if I do understand the difference of the State and Strategy pattern. I added what I think is important to my understand.... --Dom 03:08, 20 August 2008 (UTC)

The difference between strategy and state is the intent. The Strategy pattern is used when the purpose is to provide different functionality, using different algorithms. The State Pattern is used when the propose is to represent the different internal states that the object can have. Doing this using the state pattern has some advantages such as explicitly defining valid states and preventing the object from entering a possibly invalid state. Strategy provides functionality. State stores information. Does that help? -Jason Clutterbuck 23:07, 11 September 2008 (UTC)

Personal tools