Attachment

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

COURSE CODE: COM 213

COURSE TITLE: UNIFIED MODELING LANGUAGE

TOPIC: STATE CHART DIAGRAM

GROUP: 7

NAME MARTIC NUMBER


AZEEZ HABEEB OLAKUNLE CS/ND/P21/3749
KOLEDOWO MUJEEB GBOLAHUN CS/ND/P21/3750
ABDULJABAR FARUQ OLASUNKANMI CS/ND/P21/3739
OKEWALE TOMIWA TIMILEYIN CS/ND/P21/3751
ADEFIOYE ADELEKE PRECIOUS CS/ND/P21/3730
IBRAHIM IMOLE IYANU CS/ND/P21/3736
OLOWOOKERE ROSHEED TITILOPE CS/ND/P21/3741
KOLAWOLE JOEL OLAYEMI CS/ND/P21/3747
OMORIBA FRANKLIN TOBILOBA CS/ND/P21/3735
OGUNBUNMI QUADRI OLAYINKA CS/ND/P21/3734
AZEEZ RIDWAN LEKAN CS/ND/P21/3732
ABDULAZEEZ KHADIJAT O. CS/ND/P21/3745
OGUNBUNMI ABIODUN TESLIM CS/ND/P21/3731
IBRAHIM KHADIJAH CS/ND/P21/3754
OKE KABIRAT OPEYEMI CS/ND/P21/3733
ADELEKE ITUNU MOYINOLUWA CS/ND/P21/3752
EDEWUSI TAIWO OLUWATIMILEYIN CS/ND/P21/3742
ALAGBE JOSHUA ADESHINA CS/ND/P21/3738
CS/ND/P21/3737
CS/ND/P21/3740
CS/ND/P21/3743
CS/ND/P21/3744
CS/ND/P21/3746
CS/ND/P21/3748
CS/ND/P21/3753
STATE CHART DIAGRAM

What is State Chart Diagram in UML?

A state chart diagram, also known as a state machine diagram, is a type of diagram used in
computer programming, software engineering, and other related fields of study. It is used to
model the behavior of a system by depicting the different states that a system can be in and the
transitions between those states.

Each state represents a different condition of the system and is connected to other states through
arrows that represent the possible transitions between them. The state chart diagram can be used
to show the different reactions or actions that occur when the system moves from one state to
another.

Definition of State Chart Diagram

A state diagram, also known as a state machine diagram or state chart diagram, is an illustration
of the states an object can attain as well as the transitions between those states in the Unified
Modeling Language (UML). In this context, a state defines a stage in the evolution or behavior
of an object, which is a specific entity in a program or the unit of code representing that entity.

State Chart Diagram Example


There is a total of two types of state machine diagram in UML:
1. Behavioral State Chart Diagram
 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 diagram in
OOAD.
2. Protocol State Chart Diagram
 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.

Uses of state diagrams

A state chart diagram, also known as a state machine diagram or state transition diagram, is often
used in software engineering to model the behavior of a system or entity. Here are some common
uses of state chart diagrams:

1. Modeling the behavior of an object: A state chart diagram is used to model the behavior of an
object or system by defining various states, transitions, and events.

2. Designing and implementing software: State chart diagrams are also used to design and
implement software systems, particularly those with complex behavior. For example, a state
chart diagram can be used to model the behavior of a user interface or a complex algorithm.

3. Debugging software: State chart diagrams can be useful for debugging complex software
systems. A state chart diagram can be used to identify potential states and transitions that may be
causing problems or errors in the system.

4. Analyzing and improving business processes: State chart diagrams can be used to analyze and
improve business processes. By modeling the flow of events and states in a business process, it is
possible to identify inefficiencies or areas for improvement.
5. Controlling systems: State chart diagrams are used to control various systems with switches,
relays, and other components. For example, a state chart diagram can be used to control the
behavior of a traffic light or a vending machine.

6. Listing the events responsible for altering system states.

7. Modeling dynamic behavior and activity of a system.

8. Understanding the response of a system to different types of stimuli.

9. Representing finite state machines graphically.

10. Visualizing the entire lifecycle of an object.

Basic Element and Notation in State Chart diagrams?

1. State: A state represents a condition or situation of an object or system. It is represented by a


rectangle with rounded corners.

2. Initial state: The initial state represents the starting point of the system. It is represented by a
filled circle.

3. Final state: The final state represents the end point of the system. It is represented by a circle
with a dot inside.

4. Transition: A transition represents a change of state in the system. It is represented by an


arrow connecting two states.

5. Event: An event is a trigger that causes a transition from one state to another. It is represented
by a small label on the transition arrow.

6. Guard condition: A guard condition is a Boolean expression that must be true for a transition
to occur. It is represented by a square bracket on the transition arrow.
7. Action: An action is a task that is performed when a transition occurs. It is represented by a
label on the transition arrow.

8. History States: A history state is used to remember the previous state of a state machine when
it was interrupted. The following diagram illustrates the use of history states. The example is a
state machine belonging to a washing machine.

9. Concurrent Regions: A state may be divided into regions containing sub-states that exist and
execute concurrently.

Process of Modeling State Chart Diagram

The process of modeling a state chart diagram typically involves the following steps:

1. Identify the system or object to be modeled: The first step is to identify the system or object
that you want to model using a state chart diagram. This could be a software system, a control
system, or a business process.

2. Identify the states: Next, you need to identify the different states that the system or object can
be in. This could include states such as "idle," "processing," "error," or "complete."

3. Identify the events: Once you have identified the states, you need to identify the events that
cause the system or object to transition from one state to another. This could include events such
as "start," "stop," "error detected," or "task complete."

4. Create the diagram: Using a state chart diagram tool or software, you can create the diagram
by representing the states as nodes and the events as transitions between the nodes. You can also
add additional information such as actions, conditions, and guards to the transitions.

5. Test and refine: Finally, you should test the state chart diagram to ensure that it accurately
represents the behavior of the system or object. You may need to refine the diagram based on
feedback or changes to the system or object.

Overall, the process of modeling a state chart diagram requires careful analysis and
understanding of the system or object being modeled, as well as the events and states that it can
experience.
REFERENCES

John Hopcroft and Jeffrey Ullman (1979) Introduction to Automata Theory, Languages, and
Computation, Addison-Wesley Publishing Company, Reading Mass, ISBN 0-201-02988-X

Edward J. McClusky, Introduction to the Theory of Switching Circuits, McGraw-Hill, 1965

David Harel, Statecharts: A visual formalism for complex systems. Science of Computer
Programming, 8(3):231–274, June 1987.

Tiwari, A. (2002). Formal Semantics and Analysis Methods for Simulink Stateflow.

Harel, D. (1987). A Visual Formalism for Complex Systems. Science of Computer


Programming , 231–274.

Alur, R., Kanade, A., Ramesh, S., & Shashidhar, K. C. (2008). Symbolic analysis for improving
simulation coverage of Simulink/Stateflow models. International Conference on Embedded
Software (pp. 89–98). Atlanta, GA: ACM.

Samek, Miro (2008). Practical UML Statecharts in C/C++, Second Edition: Event-Driven
Programming for Embedded Systems. Newnes. p. 728. ISBN 978-0-7506-8706-5.

You might also like