Вы находитесь на странице: 1из 9

13CSIS01I System Analysis and Design

Lab 2 Use Case Diagrams What is a Use Case Diagram?


A use case diagram is a behavioral UML diagram used to describe the user's interaction with a system. The diagram includes actors (users) and their goals (use cases), and any dependencies among those goals. It is a high-level description of a system's functionalities. A use case diagram can have many different types of users, and a single diagram can represent the various ways each of them interacts with the system. A use case, on the other hand, is a textual description explaining the sequence of events and main functionalities that is then drawn as a use case diagram. Below is an example of a use case:

Use Case Element Use Case Number Application Use Case Name Use Case Description

Description

ID to represent your use case What system or application does this pertain to The name of your use case, keep it short and sweet

Elaborate more on the name, in paragraph form.

Primary Actor Who is the main actor that this use case represents Precondition Trigger What preconditions must be met before this use case can start What event triggers this use case The basic flow should be the events of the use case when everything is perfect; there are no errors, no exceptions. This is the "happy day scenario". The exceptions will be handled in the "Alternate Flows" section. The most significant alternatives and exceptions

Basic Flow

Alternate Flows

How do we draw use cases?


Symbols used:

The Actor: the person who uses a functionality of the system. They are represented as a simple stick figure. The Use Case/Functionality: what the system's user wants to accomplish. It is represented as short text a few words at most within an oval-shaped bubble. The Line Segment: a simple, arrow-less line that connects the actor to the use case. The Uses Arrow: this arrow is drawn to indicate that, for example, action X must involve doing action Y at least once. In other words, Y is a small action that is part of the larger action, X. The example below is a top-level use case diagram depicting a ticket clerk in an airline reservation system. S/he checks in passengers, and adds or cancels reservations.

Now, if we wish to add more information about each of those three functionalities, we will draw another use case to follow up on the one above.

The Extends Arrow: is drawn to indicate that action Y is a special case behavior of the same type as the more general action, X. For example, airline passengers may prefer one type of seating over the other, but since their preference will not always be available, the seat they want must be checked for availability. Although the process of checking for window seats or aisle seats is slightly different, they are still very similar. Hence in the use case diagram, they are depicted as different actions, but extend a common, generic process called 'assigning seats'.

Exercises
Use Case #1: Use Case Element Use Case Number Application Use Case Name Use Case Description Description

1 Bank System Customer makes an ATM transaction A bank customer wishes to make a quick transaction using one of their bank's ATMs instead of going to the actual bank location.

Primary Actor Bank customer, Bank Precondition Trigger Bank customer must have a valid ATM card N/A The customer finds an ATM and inserts their card into the slot. They login using their secret number, and proceed to choose a transaction. They can withdraw cash, deposit cash, check their bank balance, or print a receipt.

Basic Flow

Alternate Flows

When the customers enters their secret number, it is false When the customer enters their ATM card, the machine fails to read it

Use Case #2: Use Case Element Use Case Number Application Use Case Name Use Case Description Description

2 Airline Reservation System Check in Incoming Passengers

The ticket clerk checks in passengers coming to board a flight.

Primary Actor Ticket Clerk Precondition Passengers already have their complete travel documents Trigger N/A Every time a passenger moves up to the ticket clerk's window, they must have their luggage weighed, and assigned a seat on the plane. The ticket clerk will take the passenger's seating preference into consideration, and search according to whether the passenger prefers a window seat, or an aisle seat.

Basic Flow

Alternate Flows

The ticket clerk tries to assign a seat, only to find there are none

References: Use Case Examples Effective Examples and Tips. D, Levy. June 12, 2013. Retrieved from URL: http://www.gatherspace.com/static/use_case_example.html
UML Use Case Diagrams: Tips and FAQ. Retrieved from URL: http://www.andrew.cmu.edu/course/90-754/umlucdfaq.html

Вам также может понравиться