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.

The state of a Person between the ages of 12 and 20 years would be best named either Teenager or Teenaged 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
Discover Study Smart

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?

These names may be identical to a corresponding activity from the Activity Diagrams.

What is normally not a good choice for a state?

A very short-lasting behavior is not a good choice for a state unless the state can be detectable from outside and is meaningfully distinct from adjacent states.

We often capture such short-lasting behavior as ..... in the State model,

We often capture such short-lasting behavior as ACTIONS in the State model, as they are often thought to be parallel to the actions in the Activity 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
Remember faster, study better. Scientifically proven.
Trustpilot Logo