Professional Documents
Culture Documents
Introduction
• A State chart diagram describes a state machine. Now to clarify it state
machine can be defined as a machine which defines different states of an
object and these states are controlled by external or internal events.
• As State chart diagram defines states it is used to model lifetime of an object.
• State chart diagram is one of the five UML diagrams used to model dynamic
nature of a system.
State chart diagrams are used to design interactive systems that respond to
either internal or external event.
State chart diagram visualizes the flow of execution from one state to another
state of an object.
The primary purpose of a state chart diagram is to model interactive systems
and define each and every state of an object.
Introduction
• They define different states of an object during its lifetime. And
these states are changed by events.
• So State chart diagrams are useful to model reactive systems.
Reactive systems can be defined as a system that responds to
external or internal events.
• State chart diagram describes the flow of control from one state to
another state.
• States are defined as a condition in which an object exists and it
changes when some event is triggered.
Introduction
• So the most important purpose of State chart diagram is to model
life time of an object from creation to termination.
• State chart diagrams are also used for forward and reverse
engineering of a system. But the main purpose is to model reactive
system.
Following are the main purposes of using State chart diagrams:
To model dynamic aspect of a system.
To model life time of a reactive system.
To describe different states of an object during its life time.
Define a state machine to model states of an object.
Introduction
State chart diagrams are used to describe various states of an
entity within the application system.
Two types of state machine diagrams
Behavioral state machine
– It captures the behavior of an entity present in the system.
– It is used to represent the specific implementation of an element.
– The behavior of a system can be modelled using behavioral state
machine diagrams.
Protocol state machine
– These diagrams are used to capture the behavior of a protocol.
– It represents how the state of protocol changes concerning the
event. It also represents corresponding changes in the system.
– They do not represent the specific implementation of an element.
Common Properties and its
notations
Initial State
Final State
State-box
State machine
Decision box
Types of State
Unified Modeling Language defines three types of states:
Simple state
– They do not have any substrate.
Composite state
– These types of states can have one or more than one substrate.
– A composite state with two or more substates is called an
orthogonal state.
Submachine state
– These states are semantically equal to the composite states.
– Unlike the composite state, we can reuse the submachine states.
Following rules must be considered while drawing a state
chart diagram:
The name of a state transaction must be unique.
The name of a state must be easily understandable and
describe the behavior of a state.
If there are multiple objects, then only essential objects
should be implemented.
Proper names for each transition and an event must be
given.
State Diagrams
It describes the behavior of a system.
Event[Guard] /Action
The state machine has a WAIT The Flowchart does not deal with
concept, i.e., wait for an action or waiting for a concept.
an event.
State machines are used for a live Flowchart visualizes branching
running system. sequences of a system.
The state machine can explore Flowchart deal with paths and
various states of a system. control flow.
Main usages of State chart
Diagram
• To model object states of a system.
• To model reactive system. Reactive system consists of reactive
objects.
• To identify events responsible for state changes.
• Forward and reverse engineering.
Summary
State chart diagrams are also called as state machine diagrams.
These diagrams are used to model the event-based system.
A state of an entity is controlled with the help of an event.
There is a total of three types of state machine diagrams: 1)
Behavioral 2) State machine 3) Protocol state machine
State chart diagram is used to capture the dynamic aspect of a
system.
A state is a specific moment in the lifespan of an object.