What bothers me about most of these is that they keep state behavior all in one class.
That can make for a big state model class.
An alternative is something like StateObjects
which uses the State Design Pattern from the Gang of Four book. The state behavior is moved to small separate classes. StateObjects has less support for transitions/events but more for extracting the behavior.
Thanks Ryan. Good review.
What bothers me about most of these is that they keep state behavior all in one class.
That can make for a big state model class.
An alternative is something like StateObjects
which uses the State Design Pattern from the Gang of Four book. The state behavior is moved to small separate classes. StateObjects has less support for transitions/events but more for extracting the behavior.