I\'ve encountered a few implementations of state pattern in my programming experience, and done a few. I\'ve seen them used in various scenarios (mostly UI and parsing). The tro
have a look at Finite State Machine. Almost every mature language has own good examples. Since you haven't specified your preferred language, I'll give you C++ example: Boost FSM library. Most probably it's much more complicated than you need, but it can give you some design hints for sure