By | August 10, 2019
state chart diagram

What is the state diagram? Basic components of the statechart diagram?

Content:

What is the state diagram?

A state diagram is a behavioral diagram.

What are the types of behavioral diagrams?

Uses of state machine?

Difference between structure and behavior diagrams?

Basic components of the statechart diagram?

Examples of state machine?

 

What is the state diagram?

A state diagram is used to represent the condition of the system at the finite instances of time. The statechart diagram is a behavioral diagram. It is used to represent the behavior. It uses finite state transitions. The statechart diagram is also called the state machine and a statechart diagram. These terms can be used interchangeably.

A statechart diagram is used to model the dynamic behavior of a class. I can be said that every class has a state but we do not model every class by using the state diagram. We formally model the states with three states. The number of states may vary.

 

state diagram

 

Types of behavior diagrams

The statechart diagram is a behavioral diagram. There are two different types of behavioral diagrams. The types are given below.

 

  1. Structure Diagram

A structure diagram is used in modeling the static structure of a system. Some examples include a class diagram, package diagram, object diagram, and deployment diagram, etc.

 

  1. Behavior diagram

This diagram is used in modeling the dynamic changes in the system. This diagram is used to model the system. This diagram is also used to construct the functionality of the system. The behavior diagram guides us through the functionality of the system. It uses the use case diagrams, activity diagrams, state chart diagrams, and interaction diagrams.

 

Difference between structure and behavior diagrams

 

state diagram

 

Read about :

What is ROM || Read Only Memory

Basic components of the statechart diagram

 

State Diagram

Initial State:

A black filled circle is used to represent the initial state of the system. This can be an initial state of a class as well.

Transition:

A solid arrow is used to represent the transition of control. This is a change from one state to another state. The event which causes the change is labeled on the arrow.

 

State:

Rounded rectangle shape represents a state. It represents the condition of an object.

 

Fork:

A rounded solid rectangular bar is used to represent the fork. Fork notation is used to represent the splitting of a state into more than one.

 

Join:

A rounded solid rectangular bar is used to represent the join. The join notation converges two or more states into one.

Self-Transition:

A solid arrow that points back to the state itself is used to represent the self-transition.

 

Composite state:

A rounded rectangular is used to represent a composite state. A state with internal activities is represented by the composite state.

 

Final state:

A filled circle within a circle is used to represent the final state.

 

Example #1

Below is an example of a state machine for use case vote

 

state machine

 

Example #2

Here is another very easy example of a Statediagram for online order.

 

 

As you read about the state diagram. Here are many other related topics.

What is UML

 

 

 

 

 

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *