0% found this document useful (0 votes)
103 views8 pages

Use Case Diagram Tutorial (Guide With Examples)

This document provides a tutorial on use case diagrams, including: - An overview of use case diagrams, their purpose, and the topics covered in the tutorial. - Descriptions of the four main elements in use case diagrams: actors, use cases, systems, and packages. - Explanations of the five relationship types in use case diagrams: association between actors and use cases, generalization of actors, extend between use cases, include between use cases, and generalization of use cases. - Examples are provided to illustrate each relationship type.

Uploaded by

agus mulyana
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
0% found this document useful (0 votes)
103 views8 pages

Use Case Diagram Tutorial (Guide With Examples)

This document provides a tutorial on use case diagrams, including: - An overview of use case diagrams, their purpose, and the topics covered in the tutorial. - Descriptions of the four main elements in use case diagrams: actors, use cases, systems, and packages. - Explanations of the five relationship types in use case diagrams: association between actors and use cases, generalization of actors, extend between use cases, include between use cases, and generalization of use cases. - Examples are provided to illustrate each relationship type.

Uploaded by

agus mulyana
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/ 8

Use Case Diagram Tutorial ( Guide

with Examples )
19 February 2015

Use case diagram is a behavioral UML diagram type and frequently used to
analyze various systems. They enable you to visualize the different types of
roles in a system and how those roles interact with the system. This use case
diagram tutorial will cover the following topics and help you create better use
cases.

 Importance of use case diagrams


 Use case diagram objects
 Use case diagram guidelines
 Relationships in use case diagrams
 How to create use case diagrams ( with example )
o Identifying actors
o Identifying use cases
o When to use “Include”
o How to use generalization
o When to use “Extend”
 Use case diagram templates of common scenarios

Importance of Use Case Diagrams


As mentioned before use case diagram are used to gather a usage
requirement of a system. Depending on your requirement you can use that
data in different ways. Below are few ways to use them.

 To identify functions and how roles interact with them – The


primary purpose of use case diagrams.
 For a high level view of the system – Especially useful when
presenting to managers or stakeholders. You can highlight the roles that
interact with the system and the functionality provided by the system
without going deep into inner workings of the system.
 To identify internal and external factors – This might sound simple
but in large complex projects a system can be identified as an external
role in another use case.
Use Case Diagram objects
Use case diagrams consist of 4 objects.

 Actor
 Use case
 System
 Package

The objects are further explained below.

Actor

Actor in a use case diagram is any entity that performs a role in one given
system. This could be a person, organization or an external system and
usually drawn like skeleton shown below.

Use Case

A use case represents a function or an action within the system. Its drawn
as an oval and named with the function.

System

System is used to define the scope of the use case and drawn as a
rectangle. This an optional element but useful when your visualizing large
systems. For example you can create all the use cases and then use the
system object to define the scope covered by your project. Or you can even
use it to show the different areas covered in different releases.
Package

Package is another optional element that is extremely useful in complex


diagrams. Similar to class diagrams, packages are used to group together
use cases. They are drawn like the image shown below.
Use Case Diagram Relationships
Explained with Examples
17 February 2015

When it comes to drawing use case diagrams one area many struggle with
is showing various relationships in use case diagrams. In fact many tend to
confuse <<extend>>, <<include>> and generalization. This article will look
into various use case diagram relationships in detail and explain them using
examples. To get a deeper understanding of use cases check out our use
case diagram tutorial.

There can be 5 relationship types in a use case diagram.

 Association between actor and use case


 Generalization of an actor
 Extend between two use cases
 Include between two use cases
 Generalization of a use case

Lets take a look at these relationships in detail.

Association Between Actor and Use Case


This one is straightforward and present in every use case diagram. Few things
to note.

 An actor must be associated with at least one use case.


 An actor can be associated with multiple use cases.
 Multiple actors can be associated with a single use case.
Different ways association relationship appears in use case diagrams

Checkout the use case diagram guidelines for other things to consider when
adding an actor.

Generalization of an Actor
Generalization of an actor means that one actor can inherit the role of an
other actor. The descendant inherits all the use cases of the ancestor. The
descendant have one or more use cases that are specific to that role. Lets
expand the previous use case diagram to show the generalization of an actor.

A generalized actor in an use case diagram


Extend Relationship Between Two Use Cases
Many people confuse the extend relationship in use cases. As the name
implies it extends the base use case and adds more functionality to the
system. Here are few things to consider when using the <<extend>>
relationship.

 The extending use case is dependent on the extended (base) use


case. In the below diagram the “Calculate Bonus” use case doesn’t
make much sense without the “Deposit Funds” use case.
 The extending use case is usually optional and can be triggered
conditionally. In the diagram you can see that the extending use case is
triggered only for deposits over 10,000 or when the age is over 55.
 The extended (base) use case must be meaningful on its own. This
means it should be independent and must not rely on the behavior of
the extending use case.

Lets expand our current example to show the <<extend>> relationship.

Extend relationship in use case diagrams

Although extending use case is optional most of the time it is not a must. An
extending use case can have non optional behavior as well. This mostly
happens when your modeling complex behaviors.

For example in an accounting system one use case might be “Add Account
Ledger Entry”. This might have extending use cases “Add Tax Ledger Entry”
and “Add Payment Ledger Entry”. These are not optional but depend on the
account ledger entry. Also they have their own specific behavior to be
modeled as a separate use case.
Include Relationship Between Two Use Cases
Include relationship show that the behavior of the included use case is part of
the including (base) use case. The main reason for this is to reuse the
common actions across multiple use cases. In some situations this is done to
simplify complex behaviors. Few things to consider when using the
<<include>> relationship.

 The base use case is incomplete without the included use case.
 The included use case is mandatory and not optional.

Lest expand our banking system use case diagram to show include
relationships as well.

Includes is usually used to m


Difference Between Include and Exclude

You might also like