Se 6
Se 6
Experiment: To draw the behavioural view diagram: State-chart diagram, Activity diagram, Swimlane
diagram.
1.Objective:
To draw the behavioral view diagram: State-chart diagram, Activity diagram, Swimlane
diagram.
2.Introduction:
Behavioral UML diagrams -
Complex applications need collaboration and planning from multiple teams and hence require
a clear and concise way to communicate amongst them. So, UML becomes essential to
communicate with non-programmers about essential requirements, functionalities, and
processes of the system. UML is linked with object-oriented design and analysis. UML makes
use of elements and forms associations between them to form diagrams. Behavioral UML
diagrams focus on illustrating the dynamic aspects of a software system, showcasing how it
behaves, responds to stimuli, and undergoes state changes during runtime.
Behavior diagrams show the dynamic behavior of the objects in a system, which can be
described as a series of changes to the system over time.
There are seven types of behavior diagrams as follows:
▪ Use Case Diagram
▪ Activity Diagram
▪ State Machine Diagram
▪ Sequence Diagram
▪ Communication Diagram
▪ Interaction Overview Diagram
▪ Timing Diagram
State-chart diagrams are useful to model the reactive systems. Reactive systems can be
defined as a system that responds to external or internal events. State-chart diagram is one of
the five UML diagrams used to model the dynamic nature of a system. They define different
states of an object during its lifetime and these states are changed by events. Reactive systems
can be defined as a system that responds to external or internal events.
A state diagram is used to represent the condition of the system or part of the system at finite
instances of time. It’s a behavioural diagram and it represents the behaviour State Machine
diagrams are also referred to as State Machines Diagrams and State-Chart Diagrams.
1
CS3CO40(P): Software Engineering Laboratory Experiment no- 6
Experiment: To draw the behavioural view diagram: State-chart diagram, Activity diagram, Swimlane
diagram.
•These terms are often used interchangeably. So simply, a state machine diagram is
used to model the dynamic behaviour of a class in response to time and changing
external stimuli.
• We can say that each and every class has a state but we don’t model every class using
State Machine diagrams.
• We prefer to model the states with three or more states.
Components of a State Machine diagram:
2
CS3CO40(P): Software Engineering Laboratory Experiment no- 6
Experiment: To draw the behavioural view diagram: State-chart diagram, Activity diagram, Swimlane
diagram.
Activity Diagram:
Activity diagrams are an essential part of the Unified Modeling Language (UML) that
help visualize workflows, processes, or activities within a system. They depict how
different actions are connected and how a system moves from one state to another. By
offering a clear picture of both simple and complex workflows, activity diagrams make it
easier for developers and stakeholders to understand how various elements interact in a
system.
Activity diagrams show the steps involved in how a system works, helping us understand the
flow of control. They display the order in which activities happen and whether they occur one
after the other (sequential) or at the same time (concurrent). These diagrams help explain
what triggers certain actions or events in a system.
• An activity diagram starts from an initial point and ends at a final point, showing
different decision paths along the way.
• They are often used in business and process modeling to show how a system behaves
over time.
3
CS3CO40(P): Software Engineering Laboratory Experiment no- 6
Experiment: To draw the behavioural view diagram: State-chart diagram, Activity diagram, Swimlane
diagram.
1. Initial State: The starting state before an activity takes place is depicted using the initial
state.
3. Action Flow or Control flows: Action flows or Control flows are also referred to as paths
and edges. They are used to show the transition from one activity state to another activity
state.
4. Decision node and Branching: When we need to make a decision before deciding the
flow of control, we use the decision node. The outgoing arrows from the decision node can be
labelled with conditions or guard expressions. It always includes two or more output arrows.
6. Fork: Fork nodes are used to support concurrent activities. When we use a fork node when
both the activities get executed concurrently i.e. no decision is made before splitting the
activity into two parts. Both parts need to be executed in case of a fork statement.
7. Join: Join nodes are used to support concurrent activities converging into one. For join
notations we have two or more incoming edges and one outgoing edge.
4
CS3CO40(P): Software Engineering Laboratory Experiment no- 6
Experiment: To draw the behavioural view diagram: State-chart diagram, Activity diagram, Swimlane
diagram.
8. Merge or Merge Event: Scenarios arise when activities which are not being executed
concurrently have to be merged. We use the merge notation for such scenarios. We can
merge two or more activities into one if the control proceeds onto the next activity
irrespective of the path chosen.
9. Final State or End State: The state which the system reaches when a particular process or
activity ends is known as a Final State or End State.
Swimlane Diagram:
5
CS3CO40(P): Software Engineering Laboratory Experiment no- 6
Experiment: To draw the behavioural view diagram: State-chart diagram, Activity diagram, Swimlane
diagram.
more robust and efficient system. In this article, we will discuss the what is swimlane
diagram, its benefits, attributes, elements, and steps to draw a swimlane diagram.
A swimlane diagram is a popular tool for visualizing processes, but its journey to
becoming a staple in various fields, including system design, has been an interesting
evolution.
• Swimlane diagrams and swimlane flowcharts are essentially the same thing.
• Both terms refer to a type of flowchart that uses horizontal or vertical lanes to show
the different steps in a process and who is responsible for each step.