Lecture Notes 1.3.5

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

Behavior Diagrams –

1. State Machine Diagrams – 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 behavioral diagram and it represents the behavior using
finite state transitions. State diagrams are also referred to as State
machines and State-chart Diagrams . These terms are often used
interchangeably.So simply, a state diagram is used to model the
dynamic behavior of a class in response to time and changing
external stimuli.

2. Activity Diagrams – We use Activity Diagrams to illustrate the


flow of control in a system. We can also use an activity diagram to
refer to the steps involved in the execution of a use case. We model
sequential and concurrent activities using activity diagrams. So, we
basically depict workflows visually using an activity diagram.An
activity diagram focuses on condition of flow and the sequence in
which it happens. We describe or depict what causes a particular
event using an activity diagram.

3. Use Case Diagrams – Use Case Diagrams are used to depict the
functionality of a system or a part of a system. They are widely used
to illustrate the functional requirements of the system and its
interaction with external agents(actors). A use case is basically a
diagram representing different scenarios where the system can be
used. A use case diagram gives us a high level view of what the
system or a part of the system does without going into
implementation details.

4. Sequence Diagram – A sequence diagram simply depicts


interaction between objects in a sequential order i.e. the order in
which these interactions take place.We can also use the terms event
diagrams or event scenarios to refer to a sequence diagram.
Sequence diagrams describe how and in what order the objects in a
system function. These diagrams are widely used by businessmen
and software developers to document and understand requirements
for new and existing systems.

5. Communication Diagram – A Communication Diagram(known as


Collaboration Diagram in UML 1.x) is used to show sequenced
messages exchanged between objects. A communication diagram
focuses primarily on objects and their relationships. We can
represent similar information using Sequence diagrams,however,
communication diagrams represent objects and links in a free form.

6. Timing Diagram – Timing Diagram are a special form of Sequence


diagrams which are used to depict the behavior of objects over a
time frame. We use them to show time and duration constraints
which govern changes in states and behavior of objects.

7. Interaction Overview Diagram – An Interaction Overview


Diagram models a sequence of actions and helps us simplify
complex interactions into simpler occurrences. It is a mixture of
activity and sequence diagrams.

2 Use Case Diagrams


The purpose of use case diagram is to capture the dynamic aspect of a
system. However, this definition is too generic to describe the purpose,
as other four diagrams (activity, sequence, collaboration, and
Statechart) also have the same purpose. We will look into some specific
purpose, which will distinguish it from other four diagrams.
Use case diagrams are used to gather the requirements of a system
including internal and external influences. These requirements are
mostly design requirements. Hence, when a system is analyzed to
gather its functionalities, use cases are prepared and actors are
identified.
When the initial task is complete, use case diagrams are modelled to
present the outside view.
In brief, the purposes of use case diagrams can be said to be as follows
 Used to gather the requirements of a system.
 Used to get an outside view of a system.
 Identify the external and internal factors influencing the system.
 Show the interaction among the requirements are actors.
How to Draw a Use Case Diagram?
Use case diagrams are considered for high level requirement analysis of
a system. When the requirements of a system are analyzed, the
functionalities are captured in use cases.
We can say that use cases are nothing but the system functionalities
written in an organized manner. The second thing which is relevant to
use cases are the actors. Actors can be defined as something that
interacts with the system.
Actors can be a human user, some internal applications, or may be some
external applications. When we are planning to draw a use case
diagram, we should have the following items identified.
 Functionalities to be represented as use case
 Actors
 Relationships among the use cases and actors.
Use case diagrams are drawn to capture the functional requirements of a
system. After identifying the above items, we have to use the following
guidelines to draw an efficient use case diagram
 The name of a use case is very important. The name should be
chosen in such a way so that it can identify the functionalities
performed.
 Give a suitable name for actors.
 Show relationships and dependencies clearly in the diagram.
 Do not try to include all types of relationships, as the main
purpose of the diagram is to identify the requirements.
 Use notes whenever required to clarify some important points.
Following is a sample use case diagram representing the order
management system. Hence, if we look into the diagram then we will
find three use cases (Order, SpecialOrder, and NormalOrder) and
one actor which is the customer.
The SpecialOrder and NormalOrder use cases are extended
from Order use case. Hence, they have extended relationship. Another
important point is to identify the system boundary, which is shown in
the picture. The actor Customer lies outside the system as it is an
external user of the system.

Where to Use a Use Case Diagram?


As we have already discussed there are five diagrams in UML to model
the dynamic view of a system. Now each and every model has some
specific purpose to use. Actually these specific purposes are different
angles of a running system.
To understand the dynamics of a system, we need to use different types
of diagrams. Use case diagram is one of them and its specific purpose is
to gather system requirements and actors.
Use case diagrams specify the events of a system and their flows. But
use case diagram never describes how they are implemented. Use case
diagram can be imagined as a black box where only the input, output,
and the function of the black box is known.
These diagrams are used at a very high level of design. This high level
design is refined again and again to get a complete and practical picture
of the system. A well-structured use case also describes the pre-
condition, post condition, and exceptions. These extra elements are used
to make test cases when performing the testing.
Although use case is not a good candidate for forward and reverse
engineering, still they are used in a slightly different way to make
forward and reverse engineering. The same is true for reverse
engineering. Use case diagram is used differently to make it suitable for
reverse engineering.
In forward engineering, use case diagrams are used to make test cases
and in reverse engineering use cases are used to prepare the requirement
details from the existing application.
Use case diagrams can be used for −
 Requirement analysis and high level design.
 Model the context of a system.
 Reverse engineering.
 Forward engineering.

You might also like