Lecture Slides For: UML and Use Cases
Lecture Slides For: UML and Use Cases
Overview
What is UML ?
UML is not a language in the same way that we view programming
languages such as ‘C++’, ‘Java’ or ‘Basic’.
UML is however a language in the sense that it has syntax and semantics
which convey meaning, understanding and constraints (i.e. what is right
and wrong and the limitations of those decisions) to the reader and thereby
allows two people fluent in that language to communicate and understand
the intention of the other.
UML represents a collection of 13 essentially graphical (i.e. drawing)
notations supplemented by textual descriptions designed to capture
requirements and design alternatives. You don’t have to use them all, you
just chose the ones that capture important information about the system
you are working on.
UML is to software engineers what building plans are to an architect and
an electrical circuit diagrams is to an electrician.
5
Actor(s).
Use cases.
Associations/Relationships among
actors and use cases.
9
Use cases are drawn as ellipses with the name of the use case written inside
the ellipse.
Use case name typically consists of an active verb and one or more nouns that
concisely describe the system function modeled.
Use case
11
Use Cases: is a collection of related scenarios that describe actors using a system
to support a goal.
• Request Cash
• Request Balance
• Request Statement
• Request Cheque book
• Let’s take the ‘Request Cash’ use-case and identify the interaction
that takes place between user (a person with an ID card wishing to
borrow money) and the system (the cash dispenser/ATM).
14
Customer
• As a user, you expect a library to offer you the following services and the
librarian, being a domain expert will know how to perform these tasks.
Library Use-cases
• Checking out a book for loan.
• Checking in a returned book.
• Checking if a book is in stock and where to find it.
• Reserving a book that is currently out on loan.
• Dealing with payment of overdue fines.
• Adding new members to the library.
• Deleting old members from the library.
• Dealing with changes of members details e.g. name address etc.
• In this case the librarian is part of the system that we are trying to automate
and he/she may or may not be present in the automated version or at the
very least he or she may find their job has changed
Use Case(s)
Each use case have an associated behavior specification which describes the sequence
of actions making up a use case scenario.
Actor: Librarian
Example:
Cashier Log in, Cash out.
Customer Buy items, Refund items.
21
Example:
• Withdraw cash from an ATM.
• Order a product.
• Register for courses at a school.
• Check the spelling.
• Handle a call.
22
Example 1
2- Define actors and use cases:
Example 1 (cont.)
3- Use cases in HL format:
Example 1 (cont.)
4- Use cases diagram:
25
Example 2
Example 2 (cont.)