Professional Documents
Culture Documents
4 UML UseCase Diagram
4 UML UseCase Diagram
• Maybe your idea is for a new app, and every time you talk about it
people don’t really understand how they’d interact with the app or
what it would do.
• This type of scenario is where a Use Case diagram is very helpful.
A system is whatever you’re developing.
You represent a system with a rectangle, and you put the name
of the system at the top.
We’re going to build a Use Case diagram for a very simple
Banking Application.
First, it’s important to note that these actors are external objects.
If the Customer goes on the app to see how much money is in their
account, only then does the Bank engage with our system to provide the
balance.
Primary actors should be to the and secondary actors should be to the right.
left of the system
This just visually reinforces the fact that Customer engages with
the Banking App and then the Bank reacts
The next element is a Use Case and this is where you really start to describe
what your system does.
A Use Case is depicted with this oval shape and it represents an action that
accomplishes some sort of task within the system.
They’re going to be placed within the rectangle because they’re actions that
occur within the Banking App.
So what is our Banking App going to do?
So if this is what our Banking App does, we’re going
to have Use Cases that describe each of those actions.
So each actor has to interact with at least one of the Use Cases
within our system.
An Include relationship shows dependency between a base use case and an included use case.
Every time the base use case is executed, the included use case is executed as well.
Another way to think of it is that the base use case requires an included use case in order to be complete.
When you have an include relationship, you draw a dashed line with an arrow that points towards the included use
case.
So in our example, Log In is the base use case and Verify Password is the included use case.
Every time a Customer Logs In, our Banking App will automatically Verify Password.
This Log In use case won’t be complete unless Verify Password is complete.
An extend relationship has a base use case and an extend use case.
When the base use case is executed, the extend use case will happen sometimes but not every time.
The extend use case will only happen if certain criteria are met.
In our example, Log In is a base use case and Display Login Error is an extended use case.
Our Banking App won’t display a Login Error Message every time a Customer logs in.
This will only happen once in a while when a Customer accidently enters an incorrect password.
If you sneeze, you will close your eyes.
That’s an included relationship because it’s going to happen every time.
Additionally, if you sneeze, you might say excuse me.
That’s an extended relationship because it supplements the sneeze, but isn’t completely necessary in the sneezing
process.
Just remember that include happens every time, extend happens just sometimes,
If you sneeze, you will close your eyes.
Just remember that include happens every time, extend happens just
sometimes,
The last type of relationship we’ll discuss is
Generalization, also known as inheritance.
55
ACTOR:
What is an actor?
• An actor is some one or something that must interact with the system under
development
• UML notation for actor is stickman, shown below.
56
ACTOR:
• Actors are not part of the system they represent anyone or anything that must interact
with the system.
• Actors carry out use cases and a single actor may perform more than one use cases.
57
ACTOR:
• Those are responsible for its use and maintain as well as other
systems that interact with the developed system.
• An actor may
- input information to the system.
- receive information from the system.
- input to and out from the system.
58
ACTOR:
How do we find the actor?
4-Categories of an actor:
60
• 1)Primary/principle Actor: People who use the main system functions are refereed
as primary or principle actors. Example: in ATM system primary actor is customer
• 2)Secondary Actor: People who perform administrative or maintenance task are
referred as secondary actors. It provides a service to the system under design.
Example: in ATM system a person in charge of loading money into the system is a
secondary actor.
• 3)External actor: The hardware devices which are required as apart of application
domain and must be used are referred as external actors. Example: in ATM system
printer is an external actor.
• 4)Other system actor: The other system with which the system must interact
referred as other system actors. Example: in ATM system bank network system is
another system actor.
USE CASE:
What is USE case?
• A use case is a pattern of behavior, the system exhibits
• Each use case is a sequence of related transactions
performed by an actor and the system in dialogue.
• USE CASE is dialogue between an actor and the system.
• Examples:
• Most of the use cases are generated in initial phase, but you find
some more as you proceed.
63
USE CASE:
64
USE CASE:
• Does the system store information? What actors will create, read, update. Or
delete that information?
• Does the system need to notify an actor about changes in its internal state?
65
USE CASE:
• Generic format for documenting the use case:
- Pre condition: If any
• Use case : Name of the case.
• Actors : List of actors(external agents), indicating who
initiates the use case.
• Purpose : Intention of the use case.
• Overview : Description.
• Type : primary / secondary.
• Post condition: If any
• Typical Course of Events:
ACTOR ACTION : Numbered actions of the actor.
SYSTEM RESPONSE : Numbered description of system responses.
66
USE CASE:
USE CASE documentation example:
• The following use case describes the process of opening a new
account in the bank.
Use case :Open new account
Actors :Customer, Cashier, Manager
Purpose :Like to have new saving account.
Description :A customer arrives in the bank to open the new
account. Customer requests for the new
account
form, fill the same and submits, along with the
minimal deposit. At the end of complete
successful
process customer receives the passbook.
Type :Primary use case.
67
Grouping USE CASES:
• Those use case functionality which are directly dependent
on the system environment are placed in interface objects
68