2.1 usecase diagram

28
1 Use case Diagram Use case Diagram Use case specification Use case specification Use case specification Use case specification Object-Oriented Systems Development Bahrami © Irwin/ McGraw-Hill

Upload: ashenafi-workie

Post on 15-Jul-2015

507 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: 2.1 usecase diagram

1

Use case DiagramUse case Diagram

Use case specificationUse case specificationUse case specificationUse case specification

Object-Oriented Systems Development Bahrami © Irwin/ McGraw-Hill

Page 2: 2.1 usecase diagram

USE CASE DIAGRAMUSE CASE DIAGRAM

System behavior is captured by use cases.

– Use cases describe the system, its environment,and the relationship between the system andits environment.its environment.

– “A use case diagram is a graphic representationof the key features of the written use casereports that comprise a system.”

(McLeod, Jordan)

Page 3: 2.1 usecase diagram

What Is a Use-Case Model?• A model that describes a system’s functional

requirements in terms of use cases• Represents

– system’s intended functionality (use cases)and its environment (actors)

Page 4: 2.1 usecase diagram

What Is an Actor?Actors are not part of the system.Actors representroles a user of the system can play. anything that interacts with the system a human, a machine, or system.

Actors are EXTERNAL.

a human, a machine, or system.They can actively interchange information

with the system.They can be a giver of information.They can be a passive recipient of

information. Actor

Page 5: 2.1 usecase diagram

Who will supply, use, or remove information? Who will use this functionality? Who is interested in a certain requirement? Where in the organization is the system

Useful Questions in Finding Actors?Useful Questions in Finding Actors?

Actor Where in the organization is the system

used? What are the system’s external resources? What other systems will need to interact with

this one?

Page 6: 2.1 usecase diagram

USEUSE CASECASE:: a sequence of actions asystem performs that yields anobservable result of value to aparticular actor. Use Case

Use Cases and ActorsUse Cases and Actors

A use case models a dialog between actors and thesystem. A use case is initiated by an actor toinvoke a certain functionality in the system.

Page 7: 2.1 usecase diagram

QuestionsQuestions toto findfind useuse casescases..– For each actor you have identified,

what are the tasks the system wouldbe involved in?

– Does the actor need to be informedabout certain occurrences in theabout certain occurrences in thesystem?

– Will the actor need to inform thesystem about sudden, externalchanges?

– What information must be modified orcreated in the system?

Page 8: 2.1 usecase diagram

Object-Oriented Systems Development Bahrami © Irwin/ McGraw-Hill

Page 9: 2.1 usecase diagram

Brief Overview of Use Case Core Components and Structure

Page 10: 2.1 usecase diagram

Brief Overview of Use Case Core Components and Structure

Page 11: 2.1 usecase diagram

Relationship between Use-CaseRelationship between Use-Case

Page 12: 2.1 usecase diagram

– Use the include relationship to showthat•the behavior of one use case is wholly and

unconditionally used in another use case

Perform Transaction

The Perform Transactionuse case includes the

Perform Transaction

Send Command Receive Response

Application «include» «include»

use case includes theprocessing specified byboth the Send Commandand Receive Responseuse cases.

Page 13: 2.1 usecase diagram

Use Case Diagram Rules

• Use the generalizationgeneralization relationship to showthat– a use case is a specialization of another

use case

Run Applications Install Applications

User Super User

A User can Run Applications.A Super User can InstallApplications and RunApplications, since a SuperUser is a specialization ofUser.

Page 14: 2.1 usecase diagram

• Use the extendextend relationship to show that

– one use case conditionally augment (orextend) the behavior of another usecase.

Page 15: 2.1 usecase diagram

1. Actor2. Use case3. Association4. System Boundary

Object-Oriented Systems Development Bahrami © Irwin/ McGraw-Hill

Page 16: 2.1 usecase diagram

5. Include6. Extend7. Generalization8. Dependency9. Comment10. Artifact

Object-Oriented Systems Development Bahrami © Irwin/ McGraw-Hill

Page 17: 2.1 usecase diagram

Types of Actors1. Initiating actor ( primary actor or “user”):

initiates the use case to realize a goal

2. Participating actor (Secondary actor):participates in the use case but does not initiateparticipates in the use case but does not initiateit:

3. Supporting actor:helps the system-to-be to complete the use case

4. Offstage actor: passively participates in theuse case, i.e., neither initiates nor helpscomplete the use case

Page 18: 2.1 usecase diagram

Practice: Find the Actors• In the Course Registration System Requirements

document, read the Problem Statement for theCourse Registration case study.

• As a group, identify the following– Actors– Description of the actor

Page 19: 2.1 usecase diagram

Use-Case Specifications• Name• Brief description• Flows of Events• Relationships• Activity diagrams

Use-Case Model

Actor• Activity diagrams• Use-Case diagrams• Special

requirements• Pre-conditions• Post-conditions• Other diagrams Use-Case Specifications

...

Actors Use

Cases

Page 20: 2.1 usecase diagram

Brief Overview ofUse Case Core Components and Structure –

Use Case Description

Basic Structure and Components

• Use Case: Name• Brief Description

Additional Components• Special Requirements• Data Sources *

• Brief Description• Actors• Pre-Conditions• Post-Conditions• Basic Flow• Alternate Flows• Exception Flows

• Data Sources *• Dependencies• Assumptions• Open Issues

Page 21: 2.1 usecase diagram

Scenarios..• Scenario: a set of actions performed to

achieve a goal under some conditions– Actions specified as a sequence of steps– A step is a logically complete action performed– A step is a logically complete action performed

either by the actor or the system

• Main success scenario – when things gonormally and the goal is achieved

• Alternate scenarios: When things go wrongand goals cannot be achieved

21

Page 22: 2.1 usecase diagram

Example 1Use Case 1: Buy stocksPrimary Actor: PurchaserGoals of Stakeholders:

– Purchaser: wants to buy stocks– Company: wants full transaction info

Precondition: User already has an accountMain Success Scenario

Requirements 22

Main Success ScenarioUser selects to buy stocksSystem gets name of web site from user for tradingEstablishes connectionUser browses and buys stocksSystem intercepts responses from the site and updates

user portfolioSystem shows user new portfolio standing

Page 23: 2.1 usecase diagram

Alternatives2a: System gives error message, asks for new

suggestion for site, gives option to cancel3a: Web failure.

1. Sys reports failure to user & backs up toprevious step.

2. User exits or tries again4a: Computer crashes4a: Computer crashes4b: web site does not acknowledge purchase5a: web site does not return needed info

Requirements 23

Page 24: 2.1 usecase diagram

Example 2• Use Case 2: Buy a product• Primary actor: buyer/customer• Goal: purchase some product• Precondition: Customer is already logged in

Main ScenarioCustomer browses and selects itemsCustomer goes to checkout

Requirements 24

Customer goes to checkoutCustomer fills shipping optionsSystem presents full pricing infoCustomer fills credit card infoSystem authorizes purchaseSystem confirms saleSystem sends confirming email

Page 25: 2.1 usecase diagram

Alternatives

6a: Credit card authorization failsAllows customer to reenter info

3a: Regular customerSystem displays last 4 digits of credit card

noAsks customer to OK it or change itMoves to step 6

Requirements 25

Page 26: 2.1 usecase diagram

Student Assignment5 Marks

Submission Date:14 – Nov – 201414 – Nov – 2014

Friday

Page 27: 2.1 usecase diagram

Analyze the given Use Case Diagram

Object-Oriented Systems Development Bahrami © Irwin/ McGraw-Hill

Page 28: 2.1 usecase diagram

Answer the following questions1.Which use cases will a 1.5 Marks STUDENT be able to perform?

PROFESSOR be able to perform?

REGISTRAR be able to perform?

2.Identify 2 types of actors ? 0.5 Marks

3. Identify 2 types of relationships and write clearly3. Identify 2 types of relationships and write clearlywhich relationship between which elements 0.5 Marks

4. Which use case needs to run first, Register forCourses or View Report Card? 0.5 Marks

5. If Charlie is a student and professor, which usecases will he be able to execute 1 Mark

6. Describe the functionality of this system. 1 Mark

Object-Oriented Systems Development Bahrami © Irwin/ McGraw-Hill