Behavior : State Machine Diagrams - What is a State and State Machine - Naming states
7 important questions on Behavior : State Machine Diagrams - What is a State and State Machine - Naming states
Because states are relatively persistent, they are usually named using nouns or adjectival phrases that could be applied to the underlying class name.
Can you give an explanation of the state Person.
Often, the name of the underlying class is elided so you might see a state called Teenaged [Person]
Unless there is a standard domain terminology, states are usually named after the criteria for defining the state.
For example, isTeenager, isAdult, isSeniorCitizen.
The names can also be based on the last operation handled by the object.
Give an example.
- Person.isMarried
- Book.isBorrowed
- Car.isHailed
- Worker.isRetired.
A state can also be named after a long-performing activity that is running, while in the state.
Give an example.
- Idle
- Cruising
- Searching
- Cruising
- Higher grades + faster learning
- Never study anything twice
- 100% sure, 100% understanding
For any ongoing operations, the state name is often a gerund (a verb phrase ending in “ing”),
Give an example
- Waiting
- Cruising
- Reading
- Idling
The names in a State Machine Diagram are identical to which diagrams?
What is normally not a good choice for a state?
We often capture such short-lasting behavior as ..... in the State model,
The question on the page originate from the summary of the following study material:
- A unique study and practice tool
- Never study anything twice again
- Get the grades you hope for
- 100% sure, 100% understanding