100% found this document useful (1 vote)
83 views7 pages

State Chart Diagram-Sem-III

The document discusses state chart diagrams which model the dynamic behavior of a system by showing the different states an object can be in. It defines key elements like states, transitions, events. It provides an example state chart diagram and differences between state diagrams and flowcharts.

Uploaded by

yovaris322
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
83 views7 pages

State Chart Diagram-Sem-III

The document discusses state chart diagrams which model the dynamic behavior of a system by showing the different states an object can be in. It defines key elements like states, transitions, events. It provides an example state chart diagram and differences between state diagrams and flowcharts.

Uploaded by

yovaris322
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Chapter 9

State chart Diagrams

9.0 Objective
9.1 Introduction
9.2 State Diagram
9.3 State Diagram Uses
9.4 Why State Machine Diagram
9.5 Diagram Model Elements in State chart Diagrams
9.6 Difference between State Diagram and Flowchart
9.7 To Draw a State chart Diagram
9.8 Example of State chart Diagram.
9.9 Summary
9.10 Check your Progress – Answers
9.11 Questions for Self – Study
9.12 Suggested Readings

9.0 OBJECTIVE

 To Understand the need for state chart


 To study different model elements used in the state chart diagram
 Actors
 State
9.1 INTRODUCTION

UML diagrams that depict behaviour are called state diagrams. It demonstrates a dynamic or
behavioural aspect of a system. "Dynamic aspect" describes how a state diagram shows the state
of a system at a particular moment in time.
9.2 State Diagram

Every behavioural state that a software system component is capable of showing, as well
as every state transition that the component is expected to encounter while functioning, are
represented in a state diagram, also known as a state machine or a statechart diagram.
A state diagram shows a system's or a system component's status at a given point in time. It's a
behavioural diagram that illustrates the behaviour with finite state transitions. State machines and
state-chart diagrams are other names for state diagrams. To put it simply, a state diagram shows
how a class will function dynamically both across time and in response to shifting external
stimuli. Although we can say that all classes have states, not all classes have state diagrams used
to represent them.

9.3 State Diagram Uses


The state machine diagram implements both object-oriented systems and real-world models. It
captures the system's dynamic behavior, which is utilized to distinguish between that behavior
and a system's static behavior.
Both real-world models and object-oriented systems are implemented via the state machine
diagram. It records the dynamic behaviour of the system, which is used to differentiate it from
the static behaviour of a system.

It illustrates the transformations something experiences from start to finish. Essentially, it


illustrates how an event can cause a system to alter.

The purpose of a state machine diagram is to:

1. Model the object states of a system.

2. To model the system of reactive items that makes up the reactive system.

3. To identify the specific occasions that cause state shifts.

4. To put forward and reverse engineering into practice.

9.4 Why State Machine Diagram


Since it captures the dynamic picture of a system, it represents the behaviour of a software
programme. Throughout its existence, an object transitions between several states, enabling the
lifespan to extend while the application is in use. Every condition displays some crucial
information about the item. It lays up the design of an interactive system that is capable of
responding to both outside and internal stimuli. The change from one state to another during
execution is depicted in a state machine diagram. It shows the state of an object from conception
to completion. Representing each state of a single item is the main objective. It illustrates the
components of an interactive system. It keeps track of the dynamic behaviour of the system.

9.5 Diagram Model Elements in State Chart diagrams


a) Initial State: This state shows the first activity of the flow.
b) State: A state represents the state of an object at a particular given point of time.
c) Transition: The transition from one state to another state of objects is represented by an
arrow.
d) Event and Action: A trigger that causes a transition to occur.
e) Signal: When a message or a trigger caused by an event to a state, which causes a
transition, this message is called as a signal.
f) Final State: The state diagram ends with a diagram that depicts a bull’s eye is known as
Final State

a. Initial State: The first or the default state the object is in. It is denoted by a solid circle.

Figure 9.1 – Initial state notation

b. State: All the states an object can go in are mentioned in this. It is represented by a
rectangle with rounded edges.

STATE

Figure 9.2 – state

c. Transitions: Depicted by arrow from the source state to destination state.

STATE1 STATE2
Events

Figure 9.3 – Transitions

d. Final State: Depicts the end of the State. It is shown by a bull's eye symbol.
Figure 9.4 – Final State

9.3 – 9.5 Check Your Progress

Fill in the Blanks

1. The __________ from one state to another state of objects is represented by an


arrow.
2. _________ shows the end of the State
3. State Diagram show _______ behavior of system.

e. Decision box- The decision box represents the decisions that will be made based on an
evaluated guard. A diamond shape represents it.

Decisio
n

Figure 9.5 – Decision Box

f. Fork- A fork represents a state splitting into two or more concurrent states. It is
represented by a rounded rectangular solid bar with arrows incoming from the parent
state and towards the concurrent states.

State A

State B State C

Figure 9.6 - Fork


g. Join- A join represents two or more states converging into one state. It is represented by
a rounded rectangular solid bar with arrows that are incoming from the concurrent states
and towards the common state.

State B State C

State A

Figure 9.7 Join

9.6 Difference between State Diagram and Flowchart


The main objective of a state diagram is to illustrate the many modifications made to the class's
state, not the procedures or commands that caused those modifications. A flowchart, on the other
hand, shows the steps or directives that, when followed, change the state of a class or one of its
objects.

9.7 To Draw a State Chart Diagram

The state machine diagram is used to show the several states that an object can go through. A
transition from one state to another is brought about by an event. It is necessary to identify every
possible state for a certain component before drawing a state machine diagram.
The primary goal of a state machine diagram is to depict the states of a system. These states are
required for drawing a state transition diagram. It is essential to identify the entities, conditions,
and occurrences that lead to a state transition before putting a state machine diagram into
practise.
The steps that must be included while creating a state machine diagram are as follows:
1. A distinct and intelligible term that characterises the system's behaviour ought to be given
to the state transition.
2. Only the most important of the several objects are put into practise.
3. The transitions and events need to be given appropriate names.
9.8 Example of State Chart Diagram.
This state diagram shows the process of enrollment and classes at a university. The composite
state “Enrollment” is made up of various substates that will lead students through the enrollment
process. Once the student has enrolled, they will proceed to “Being taught” and finally to “Final
exams.”

Figure 9.8 Process of Enrollment and Classes at a University

9.5 -9.8 Check your Progress

Fill in the Blanks

1. A ______represents a state splitting into two or more concurrent states.


2. A ________ represents two or more states converging into one state
3. State Diagram is similar to ________ diagram

9.9 SUMMARY

The transfer of control from one state to another is depicted in a state chart diagram.
States are described as a situation in which an object existing and undergoes a change in
response to an event. The main goal of a state chart diagram is to model an object's lifetime
from creation to destruction.
9.10 CHECK YOUR PROGRESS – ANSWERS

9.1 – 9.6
1. Transitions
2. Final State
3. Dynamic

9.6 -9.8
1. Fork
2. Join
3. Flowchart

9.11 QUESTIONS FOR SELF – STUDY


1. Describe Purpose of state chart Diagram.
2. What is a State chart diagram?
3. What is the main usage of a State chart diagram?
4. Define term fork and join in state chart diagram.

9.12 SUGGESTED READINGS


1. Unified Modeling Language User Guide by Grady Booch,James Rumbaugh,Ivar
Jacobson
2. UML 2 for Dummies by Michael Jesse Chonoles ,James A. Schardt

***

You might also like