Behavior : State Machine Diagrams - What is a State and State Machine

17 important questions on Behavior : State Machine Diagrams - What is a State and State Machine

What is a state?

A state is a condition that an object or behavior (such as a Use Case) can be in for more than a moment.

Some property (or properties) is invariant over time, and these properties are relevant to how the object behaves

What are properties n a State Machine??

Properties would include attribute (slot) values, parts and their values, and properties of associated (linked) objects and may include ongoing behavior.

The time can be of long or short duration.

What is a State Machine?

A State Machine shows the possible path of states that the object can traverse. There is only one state machine for a class.
  • Higher grades + faster learning
  • Never study anything twice
  • 100% sure, 100% understanding
Discover Study Smart

All instances of a class share the same state machine, though each instance may be in.....?

its own state, generally independent of the other instances

As a new instance is made, it becomes subject to the rules of the state machine and starts the state machine at the same...?

Initial State

As an instance is destroyed, it also ends its pass through the state machine at a ...... ?

Final State.

Similarly, every run-time execution of a behavior shares the....

behavior’s state machine and follows the legal paths as defined in the machine.

Throughout the life of the instance or the life of the behavior execution, the path through the state machine is defined by the rules of the state machine and the interactions with incoming ....?

Events

What happens if the state machine is complex?

If the state machine is sufficiently complex, it is possible that no two instances share the same state path location at the same time.

The first State example.

The  name may appear ......  used when the body of the roundtangle is otherwise empty.

The name may appear in the body of the state used when the body of the roundtangle is otherwise empty.

Because a state machine diagram is also a namespace, if two roundtangles appear with the same name on the same diagram, they represent....?

two views of the same state (and are confusing).

unnamed states are considered as each representing a ....?

unique state

Many states can be formalized by specifying a logical constraint on the obkects values (Slots)


Can you name an example?

For example, a Person is in the state of being a Teenager if the Person’s age obeys a specific constraint:


{13 ≤ Person.age ≤ 19}


In this case, an incoming event of the Person’s 20th birthday changes the state.

We can also base a state on the properties of an associated object.

Can you give an example.

A Person can be in the state of Widowed if his/her spouse is no longer living.

{Person.spouse.isLiving = False}


A subsequent marriage event can change this Person’s state.

Sometimes, a state may be based on an ongoing activity or behavior.


Can you give an example?

Consider that a Car in a hailing service can be Busy, Cruising, or Idle

How can the usefulness of a state be judged?

The usefulness of a state can be judged by examining how an object acts differently in that state as compared to other states.

What do we do when:

  • If an object accepts the same set of queries, signals, and operation calls in two different states
  • and responds identically to these behavior requests
  • the two states are essentially the same

If there is no discernable difference

Collapse the two states into one state.

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