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

9 important questions on Behavior : State Machine Diagrams - What is a State and State Machine - Overlapping States

If the two states are completely overlapping, where if the object is in the first state it is surely in the second state and viceversa, we have two ...?

identical states, no matter how we define the states.

This situation is also not a problem, just pick one name.


Example:

{ Person.Teenager  = 13 ≤

Person.age ≤   19}


{ Person.Adolescent  = 13 ≤
Person.age ≤  19}


If the two states are completely disjoint, this is the usual and preferred arrangement.


This situation is not a problem

{ Person.Teenager= 13 ≤ Person.age ≤ 19}

{ Person.Adult= 20 ≤ Person.age}

If one state is completely nested inside another, we have a state and a ...?

SUBSTATE.

By the given definitions, a Teenager is a substate of Juvenile 

Example:
  
{ Person.Juvenile = 6 ≤ Person.age ≤ 19}


{ Person.Teenager = 13 ≤
Person.age ≤ 19} 
  • Higher grades + faster learning
  • Never study anything twice
  • 100% sure, 100% understanding
Discover Study Smart

How is a substate shown?

A substate is shown as a full state in its own right but contained in its SUPERSTATE.

How do we call a parent state?

The parent state, as is any state with one or more contained REGIONS, is called a COMPOSITE STATE.

If the two states are partially overlapping yet are intrinsically related, there is a potential difficulty

Problem


{ Person.Teenager
= 13 ≤
Person.age ≤  19}


{ Person.Juvenile = 6 ≤ Person.age ≤ 15}

When two state are partially overlapping, there is a potential difficulty.

What can we do to solve whis problem?

What is often done is to use a Venn diagram approach to identify the uniquely constrained separate regions.  (see fig 18.5)

Then create seperate states for each region  (fig 18.6)
 

If the two states are partially overlapping and not intrinsically related, there are still potential solutions.

  Give one approach.

One approach is to separate the states into orthogonal aspects and to create a separate State Diagram for each aspect.

This situation may be supported by separating the attributes and operations into separate parts as shown in Fig. 18..

This approach is similar to making one of these aspects into a mode as in Section 18.1.1

Imagine that Patrons who live in the Library’s county have different permissions from Patrons of other counties, similar to the various age- based permissions. See Fig. 18.7


In the current UML version of State Machine Modeling, it is....

not directly possible to model overlapping states.

In this section, we discuss several ways of dealing with this difficulty

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