State chart diagram
- 2. Introduction
• They define different states of an object during its lifetime. States
are defined as a condition in which an object exists and it changes
when some event is triggered
• These states are changed by events.
• . So the most important purpose of Statechart diagram is to model
life time of an object from creation to termination.
• Statechart diagrams are useful to model reactive systems
-Reactive systems can be defined as a system that responds to
external or internal events.
• Statechart diagram describes the flow of control from one state to
another state.
- 3. Purpose
• Following are the main purposes of using Statechart 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.
- 4. How to draw state
charts
• Before drawing a Statechart diagram we must
have clarified the following points:
• Identify important objects to be analyzed.
• Identify the states.
• Identify the events.
- 5. Elements of state chart diagrams:
• Initial State: This shows the starting point of the
state chart diagram that is where the activity starts.
• State: A state represents a condition of a
modeled entity for which some action is performed.
The state is indicated by using a rectangle with
rounded corners and contains compartments.
• Transition: It is indicated by an arrow. Transition is a
relationship between two states which indicates that Event/ Action
an object in the first state will enter the second state
and performs certain specified actions.
• Final State: The end of the state chart diagram is
represented by a solid circle surrounded by a circle.
- 7. When to use
Statecharts
• So the main usages can be described as:
• 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.