Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • 1
    Thanks for your response Robert. It seems that you have answered the question if two states are two little and it seems the answer is No, only 2 states is not two little depending on if there is complex logic contained within the states. I don't think you answered how to manage the third "composite" state that is affected by another state...is there a best practice for this? Commented May 6, 2015 at 17:11
  • The two-state solution already covers this; just extend the same concept to three states. Did you have a more specific question? The third object can have a constructor that helps you set up the object for the third state. Note that, in my answer, I stated that it didn't matter how complex your deciding conditions are. Commented May 6, 2015 at 17:16
  • So maybe I'm missing something and you can explicitly highlight it for me. If the Seat has 3 states but the "third" state is determined by some outside info...how to best model this, I gave the specific example in my original question when I mentioned the Hiatus state. Commented May 6, 2015 at 17:19
  • If a Hiatus state is "separate and distinct," then make another object, that's all. The whole point of the pattern is to provide encapsulation between the states, just as my example about the different robot stations where each station has robots that specialize in a particular task illustrates. Commented May 6, 2015 at 17:19
  • You can find me in here, if you want to discuss this further. Commented May 6, 2015 at 17:23