You are on page 1of 7

Object Oriented Analysis & Design

Lab # 2

The objectives of lab 2 are to:


 Understand the Use Case Diagrams
 Understand and implement the UML notations for Use Case Diagrams

Use Case Diagram:


A use case diagram identifies transactions between actors and a system as individual use cases. Use cases are
written texts, diagrams are the supplementary and may help during discovery.

Use Case Diagram Notations:


The use case diagram notations include
1. System boundary
2. Actor
3. Association Relationship
4. Use case
Actor

• Actors are usually individuals involved with the system defined according to their roles. The actor can
be a human or other external system.

• Non-human actors are usually not primary users and are displayed at right side

System Boundary

• The system boundary defines the system of interest in relation to the


world around it.

• A system is shown as a rectangle, labeled with the system name

• Actors are outside the system

• Use cases are inside the system

• The rectangle shows the scope or boundary of the system

• Use case subject element in StarUML


Use Case:

• A use case describes how actors uses a system to accomplish a


particular goal

• Additional behavior can be shown with parent-child, extend and


include use cases

• It is labeled with a name that the user can understand

Association Relationship:

• An association is the communication path between an actor and


the use case that it participates in

• It is shown as a solid line

• It does not have an arrow, and is normally read from left to right

• Here, the association is between a Modeler and the Create Model


use case

Relationship in Use Case:

• There are several Use Case relationships:

• Association

• Extend

• Generalization

• Include

<<Include>> Use Case:

• Include is used to extract use case fragments that are


duplicated in multiple use cases. The included use
case cannot stand alone and the original use case is
not complete without the included one.

• For example, the flow of events that occurs at the


beginning of every ATM use case (when the user
puts in their ATM card, enters their PIN, and is
shown the main menu) would be a good candidate
for include.
<<Extend>> Use Case:

 Extend is used when a use case adds steps to another first-


class use case.
 For example, imagine "Withdraw Cash" is a use case of an
Automated Teller Machine (ATM). "Assess Fee" would
extend Withdraw Cash and describe the conditional
"extension point" that is instantiated when the ATM user does
not have the bank account in the ATM's owning institution.
Notice that the basic "Withdraw Cash" use case stands on its
own, without the extension.
 <<extend>> is a directed relationship that specifies how and when the behavior defined is usually
supplementary (optional)

Generalize Use Case:

• Generalization is a relationship between a general use case and a more specific use case that inherits
features to it
Restaurant Use Case

Sample 1: Scenario (HACS)


Homework assignment and collection are an integral part of any educational system. Today, this task is
performed manually. What we want the homework assignment distribution and collection system (HACS for
short) to do is to automate this process.
HACS will be used by the instructor to distribute the homework assignments, review the students’ solutions,
distribute suggested solution, and distribute student grades on each assignment.
HACS shall also help the students by automatically distributing the assignments to the students, provide a
facility where the students can submit their solutions, remind the students when an assignment is almost due,
and remind the students when an assignment is overdue.
Sample 02: Scenario (BBTS)
Do you know that it costs a lot of money to get a ’Certified Java Programmer’ certificate? It could cost you thousands of
euros. Let’s imagine we will develop a browser-based training system to help people prepare for such a certification
exam.
A user can request a quiz for the system. The system picks a set of questions from its database, and compose them
together to make a quiz. It rates the user’s answers, and gives hints if the user requests it. In addition to users, we also
have tutors who provide questions and hints. And also examiners who must certify questions to make sure they are not
too trivial, and that they are sensible.
Make a use case diagram to model this system. Work out some of your use cases. Since we don’t have real stake holders
here, you are free to fill in details you think is sensible for this example.
Sample 1: Solution

Sample 2: Solution
Exercise
Case study: Online Shopping
Easy Get Corporation sells books and CDs using through online shopping. The customer adds items
to her shopping cart. She may remove items or go to the check-out to make her purchases at any time.
The customer reviews her purchases, chooses a payment method and pays. A sales employee at Easy
Get Corporation gets the order and purchase confirmation from the system, and sends the electronic
order to the warehouse. The warehouse employee updates the order status. The customer may check
the order status.
Design a complete use case diagram for the Easy Get Corporation

Case Study: Inventory management


An inventory control system is an integrated package of software and hardware used in
warehouse operations, and elsewhere, to monitor the quantity, location and status of inventory as well
as the related shipping, receiving, picking and put away processes. In common usage, the term may
also refer to just the software components.
An inventory control system may be used to automate a sales order fulfillment process. Such a system
contains a list of order to be filled, and then prompts workers to pick the necessary items, and provides
them with packaging and shipping information. Modern inventory control systems rely upon
barcodes, and potentially RFID tags, to provide automatic identification of inventory objects. In an
academic study performed at Wal-Mart, RFID reduced out of Stocks by 30 percent for products selling
between 0.1 and 15 units a day. Inventory objects could include any kind of physical asset:
merchandise, consumables, fixed assets, circulating tools, library books, or capital equipment. To
record an inventory transaction, the system uses a barcode scanner or RFID reader to automatically
identify the inventory object, and then collects additional information from the operators via fixed
terminals (workstations), or mobile computers.
Draw a use case diagram for the automated inventory control system

Case Study: Alarm Clock


Suppose we want to develop software for an alarm clock. The clock shows the time of day. Using
buttons, the user can set the hours and minutes fields individually, and choose between 12 and 24-
hour display.
It is possible to set one or two alarms. When an alarm fires, it will sound some noise. The user can
turn it off, or choose to ’snooze’. If the user does not respond at all, the alarm will turn off itself
after 2 minutes. ’Snoozing’ means to turn off the sound, but the alarm will fire again after some
minutes of delay. This ’snoozing time’ is pre-adjustable.
Identify the top-level functional requirement for the clock, and model it with a use case diagram.

You might also like