31
Duration: 3 Hrs 1 Ramakant Soni Assistant Professor Dept. of Computer Science B K Birla Institute of Engineering & Technology, Pilani, India Ramakant Soni @ BKBIET Pilani

Lecture 3 use case diagram-part2

Embed Size (px)

Citation preview

Page 1: Lecture 3   use case diagram-part2

Duration: 3 Hrs

1

Ramakant SoniAssistant Professor

Dept. of Computer Science

B K Birla Institute of Engineering & Technology, Pilani, India

Ramakant Soni @ BKBIET Pilani

Page 2: Lecture 3   use case diagram-part2

Each use case represents a unit of useful functionality that subjects provide to actors.

An association between an actor and a use case indicates that the actor and the use case somehow interact or communicate with each other.

Only binary associations are allowed between actors and use cases.

Ramakant Soni @ BKBIET Pilani 2

Only binary associations are allowed between actors and use cases.

An actor could be associated to one or several use cases.

Customer actor is associated with two use cases - Browse Items and Place Order.

Page 3: Lecture 3   use case diagram-part2

A use case may have one or several associated actors.

Manage Account use case is associated with Customer and Bank actors.

Ramakant Soni @ BKBIET Pilani 3

If there are several actors associated to the same use case, it may not be obvious from use case diagram which actor initiates the use case, i.e. is a "primary actor". (In non-standard UML, primary actors are those using system services, and supporting actors are actors providing services to the system.)

Page 4: Lecture 3   use case diagram-part2

UML allows the use of multiplicity at one or both ends of an association between the actor and the use case.

Multiplicity of a Use Case

When an actor has an association to a use case with a multiplicity that is greater than one at the use case end, it means that a given actor can be involved in multiple use cases of that type.

Ramakant Soni @ BKBIET Pilani 4

Bank actor is involved in multiple Transfer Funds use cases.

use case multiplicity could mean that an actor interacts with multiple use cases: • in parallel (concurrently), or• at different points in time (overlapping), or• mutually exclusive (sequentially, random, etc).

Page 5: Lecture 3   use case diagram-part2

Multiplicity of an Actor

Required actor may be explicitly denoted using multiplicity 1 or greater.

Multiplicity 0..1 of actor means that the actor may or may not participate inany of their associated use cases.

Ramakant Soni @ BKBIET Pilani 5

Checkout use case requires Customer actor, hence the 1 multiplicity ofCustomer. The use case may not need Credit Payment Service (forexample, if payment is in cash), thus the 0..1 multiplicity.

Page 6: Lecture 3   use case diagram-part2

Two or more Player actors are involved in the Play Game use case.

Each Player participates in one Play Game.

Ramakant Soni @ BKBIET Pilani 6

Each Player participates in one Play Game.

For instance, multiplicity of actor could mean that interaction of a particular use case with several separate actor instances might be:

• simultaneous (concurrent) interaction, or• overlapping interaction, at different points in time, or• mutually exclusive (sequential, random, etc.) interaction.

Page 7: Lecture 3   use case diagram-part2

Use cases could be organized using following relationships:

• Generalization • Association • Extend • Include

Ramakant Soni @ BKBIET Pilani 7

• Include

Page 8: Lecture 3   use case diagram-part2

Generalization between Use Cases

Generalization between use cases is similar to generalization between classes –child use case inherits properties and behavior of the parent use case and may override the behavior of the parent.

Generalization is shown as a solid directed line with a large hollow triangle arrowhead, the same as for generalization between classifiers, directed from the more specific use case to the general use case.

Ramakant Soni @ BKBIET Pilani 8

Web User Authentication use case is abstract use case specialized by Login, Remember Me and Single Sign-On use cases.

Page 9: Lecture 3   use case diagram-part2

Use cases can only be involved in binary associations.

Binary Association

Binary association relates two typed instances. It is normally rendered as a solid line connecting two classifiers, or a solid line connecting a single classifier to itself (the two ends are distinct). The line may consist of one or more connected segments. Job and Year classifiers are associated

Ramakant Soni @ BKBIET Pilani 9

Job and Year classifiers are associated

Two use cases specifying the same subject cannot be associated since each of them individually describes a complete usage of the system.

Page 10: Lecture 3   use case diagram-part2

Ramakant Soni @ BKBIET Pilani 10

Page 11: Lecture 3   use case diagram-part2

Example 1:Airport check-in and security screening business model

Purpose: An example of a business use case diagram for airport check-in and security screening.

Credits to: http://www.uml-diagrams.org

Ramakant Soni @ BKBIET Pilani 11

and security screening.

Summary: Business use cases are: Individual Check-In Group Check-In (for groups of tourists) Security Screening, etc.

representing business functions or processes taking place in an airport and serving needs of passengers.

Page 12: Lecture 3   use case diagram-part2

Actors are :

• Passenger,• Tour Guide,• Minor (Child),• Passenger with Special Needs (e.g. with disabilities), all playing external

roles in relation to airport business.

Use cases are :

Ramakant Soni @ BKBIET Pilani 12

• Individual Check-In• Group Check-In (for groups of tourists),• Security Screening , etc. - representing business functions or processes

taking place in airport and serving the needs of passengers.

• Baggage Check-in and Baggage Handling <<extend>> Check-In use cases, because passenger might have no luggage, so baggage check-in and handling are optional.

Page 13: Lecture 3   use case diagram-part2

Ramakant Soni @ BKBIET Pilani 13

Page 14: Lecture 3   use case diagram-part2

Example 2: Bank ATM

Purpose: Describe use cases that an automated teller machine (ATM)provides to the bank customers.

Summary:Customer (actor) uses bank ATM to check balances of his/her bankaccounts, deposit funds, withdraw cash and/or transfer funds (use cases).

ATM Technician provides maintenance and repairs.

Ramakant Soni @ BKBIET Pilani 14

All these use cases also involve Bank actor whether it is related tocustomer transactions or to the ATM servicing.

ATM is a banking subsystem that provides bank customers with access tofinancial transactions in a public space without the need for a cashier,clerk or bank teller.

Page 15: Lecture 3   use case diagram-part2

Ramakant Soni @ BKBIET Pilani 15

Page 16: Lecture 3   use case diagram-part2

On most bank ATMs, the customer is authenticated by inserting a plasticATM card and entering a personal identification number (PIN). CustomerAuthentication use case is required for every ATM transaction so we show itas include relationship.

Ramakant Soni @ BKBIET Pilani 16

If needed, customer may ask ATM for help. ATM Transaction use case is<<extended>> via Menu extension point by the ATM Help use casewhenever ATM Transaction is at the location specified by the Menu andthe bank customer requests help, e.g. by selecting Help menu item.

Page 17: Lecture 3   use case diagram-part2

ATM Technician maintains or repairs Bank ATM. Maintenance use caseincludes Replenishing ATM with cash, ink or printer paper, Upgrades ofhardware, firmware or software, and remote or on-site Diagnostics.Diagnostics is also included in (shared with) Repair use case.

Ramakant Soni @ BKBIET Pilani 17

Page 18: Lecture 3   use case diagram-part2

Example 3:e-Library online public access catalog (OPAC)

Purpose: List top level use cases for e-Library online public access catalog.

An Online Public Access Catalog (OPAC) is an e-Library website which ispart of Integrated Library System (ILS), also known as a LibraryManagement System (LMS), and managed by a library or group of libraries.

Ramakant Soni @ BKBIET Pilani 18

Summary: Patrons of a library can search library catalog online to locatevarious resources - books, periodicals, audio and visual materials, or otheritems under control of the library. Patrons may reserve or renew item,provide feedback, and manage their account.

Page 19: Lecture 3   use case diagram-part2

Ramakant Soni @ BKBIET Pilani 19

Page 20: Lecture 3   use case diagram-part2

Example 3:Online shopping use case diagrams

Purpose: Provide top level use cases for a web customer making purchases online.

Summary: Web customer actor uses some web site to make purchases online.

Ramakant Soni @ BKBIET Pilani 20

online.

Top level use cases are:•View Items, •Make Purchase and •Client Register.

Page 21: Lecture 3   use case diagram-part2

Description:

Web Customer uses some web site to make purchases online. Top leveluse cases are View Items, Make Purchase and Client Register.

View Items ( use case) could be used by customer as top level use case ifcustomer only wants to find and see some products. This use case couldalso be used as a part of Make Purchase use case.

Ramakant Soni @ BKBIET Pilani 21

Client Register ( use case) allows customer to register on the web site.Note, that Checkout use case is <<included>> use case not available byitself.

checkout is part of make purchase.

Except for the Web Customer actor there are several other actors whichwill be described below with detailed use cases.

Page 22: Lecture 3   use case diagram-part2

Ramakant Soni @ BKBIET Pilani 22

Page 23: Lecture 3   use case diagram-part2

View Items use case is extended by several optional use cases - customermay search for items, browse catalog, view items recommended forhim/her, add items to shopping cart or wish list. All these use cases areextending use cases because they provide some optional functionsallowing customer to find item.

Ramakant Soni @ BKBIET Pilani 23

Customer Authentication use case is included in View Recommended Itemsand Add to Wish List because both require customer to be authenticated.At the same time, item could be added to the shopping cart without userauthentication.

Page 24: Lecture 3   use case diagram-part2

Checkout use case includes several required uses cases. Web customer should be authenticated. It could be done through user login page, user authentication cookie ("Remember me") or Single Sign-On (SSO).

Web site authentication service is used in all these use cases, while SSO also requires participation of external identity provider.

Checkout use case also includes Payment use case which could be done either by using credit card and external credit payment service or with PayPal.

Ramakant Soni @ BKBIET Pilani 24

PayPal.

Page 25: Lecture 3   use case diagram-part2

Ramakant Soni @ BKBIET Pilani 25

Page 26: Lecture 3   use case diagram-part2

Example 4:Credit card processing system

Purpose: Define major use cases for a credit card processing system (credit card payment gateway).

Summary: The merchant submits a credit card transaction request to thecredit card payment gateway on behalf of a customer. Bank which issued

Ramakant Soni @ BKBIET Pilani 26

credit card payment gateway on behalf of a customer. Bank which issuedcustomer's credit card is actor which could approve or reject thetransaction. If transaction is approved, funds will be transferred tomerchant's bank account.

Page 27: Lecture 3   use case diagram-part2

Credit card processing system description

Credit Card Processing System is a system under design or consideration.Primary actor for the system is a Merchant’s Credit Card Processing System.The merchant submits some credit card transaction request to the creditcard payment gateway on behalf of a customer. Bank which issuedcustomer's credit card is actor which could approve or reject thetransaction. If transaction is approved, funds will be transferred tomerchant's bank account.

Ramakant Soni @ BKBIET Pilani 27

Authorize and Capture use case is the most common type of credit cardtransaction. The requested amount of money should be first authorized byCustomer's Credit Card Bank, and if approved, is further submitted forsettlement. During the settlement funds approved for the credit cardtransaction are deposited into the Merchant's Bank account.

Page 28: Lecture 3   use case diagram-part2

Credit card processing system description

In some cases, only authorization is requested and the transaction will notbe sent for settlement. In this case, usually if no further action is taken withinsome number of days, the authorization expires. Merchants can submit thisrequest if they want to verify the availability of funds on the customer’scredit card, if item is not currently in stock, or if merchant wants to revieworders before shipping.

Capture (request to capture funds that were previously authorized) use

Ramakant Soni @ BKBIET Pilani 28

Capture (request to capture funds that were previously authorized) usecase describes several scenarios when merchant needs to complete somepreviously authorized transaction - either submitted through the paymentgateway or requested without using the system, e.g. using voiceauthorization.

Page 29: Lecture 3   use case diagram-part2

Credit card processing system description

Credit use case describes situations when customer should receive a refund for a transaction that was either successfully processed and settled through the system or for some transaction that was not originally submitted through the payment gateway.

Void use case describes cases when it is needed to cancel one or several related transactions that were not yet settled. If possible, the transactions will not be sent for settlement. If the Void transaction fails, the original

Ramakant Soni @ BKBIET Pilani 29

will not be sent for settlement. If the Void transaction fails, the original transaction is likely already settled.

Verify use case describes zero or small amount verification transactions which could also include verification of some client's data such as address.

Page 30: Lecture 3   use case diagram-part2

Ramakant Soni @ BKBIET Pilani 30

Page 31: Lecture 3   use case diagram-part2

References:

[1] http://www.uml-diagrams.org/

Ramakant Soni @ BKBIET Pilani 31