What are the differences between the Strategy design pattern and the State design pattern? I was going through quite a few articles on the web but could not make out the dif
In layman's language,
in Strategy pattern, there are no states or all of them have same state. All one have is different ways of performing a task, like different doctors treat same disease of same patient with same state in different ways.
In state Pattern, subjectively there are states, like patient's current state(say high temperature or low temp), based on which next course of action(medicine prescription) will be decided.And one state can lead to other state, so there is state to state dependency( composition technically).
If we technically try to understand it , based on code comparison of both, we might lose the subjectivity of situation,because both look very similar.