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*
- 1Thanks 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?Sean– Sean2015-05-06 17:11:30 +00:00Commented 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.Robert Harvey– Robert Harvey2015-05-06 17:16:03 +00:00Commented 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.Sean– Sean2015-05-06 17:19:09 +00:00Commented 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.Robert Harvey– Robert Harvey2015-05-06 17:19:36 +00:00Commented May 6, 2015 at 17:19
- You can find me in here, if you want to discuss this further.Robert Harvey– Robert Harvey2015-05-06 17:23:55 +00:00Commented May 6, 2015 at 17:23
| Show 2 more comments
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
- create code fences with backticks ` or tildes ~ ```
like so
``` - add language identifier to highlight code ```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible) <https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. design-patterns), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you