Top Banner
Computer Engineering Department Object Oriented Software Modeling and Design CE 350 Abdel-Karim Al-Tamimi, Ph.D. [email protected] http:// faculty.yu.edu.jo/ altamimi Al-Tamimi 2011 © 1
45
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Lecture05

Computer Engineering Department

Computer Engineering Department

Object Oriented Software Modeling and Design

CE 350Abdel-Karim Al-Tamimi, Ph.D.

[email protected]://faculty.yu.edu.jo/

altamimi

Al-Tamimi 2011 © 1

Page 2: Lecture05

Overview

• Documenting a Use-case Diagram• Developing a Use-case Diagram

Al-Tamimi 2011 © 2

Page 3: Lecture05

Documenting Use-Cases• A use-case is a description of what a system

is used for, and who uses it, without providing details of how it performs its functions

• A use-case description serves as an agreed description between the user and the system designer on the flow of events that would happen when a use case is invoked

• A use-case description is explained and elaborated through scenarios (a set of sequences of actions)

• Each of these scenarios is simply an instance of the use-case

• Use-cases are text documents not diagrams

Al-Tamimi 2011 © 3

Page 4: Lecture05

Documenting Use-Cases

Al-Tamimi 2011 © 4

Page 5: Lecture05

Documenting Use-Cases

Al-Tamimi 2011 © 5

Page 6: Lecture05

Importance of Use-Cases

• The use case model is not only useful for requirements specification but also for planning the work in different phases of the system development life cycle

• Since the use case model should be understandable by both the system developer and the user, it is quite natural to plan the development of the system by scheduling the completion dates of the use cases in the use case model

Al-Tamimi 2011 © 6

Page 7: Lecture05

Use-Case Formats

• Use-cases are written in different formats and levels of formality:– Brief: usually a one paragraph summary,

usually the main success scenario– Casual: informal paragraph format. Multiple

paragraphs that cover various scenarios– Fully dressed: all steps and variations are

written in detail, and there are supporting sections, such as preconditions and success guarantees

Al-Tamimi 2011 © 7

Page 8: Lecture05

Use-Case Template Example

Part 1

Al-Tamimi 2011 © 8

Use case name Name of the use case

Use case ID ID of the use case

Super use case The name of the generalized use case to which this use-case belongs

Actor(s) The name of the actor(s) who participates in the use case

Brief description

A description showing how this use case adds value to the organization, that is, what the purpose or role of this use case is in enabling the actors to do their job

Preconditions The conditions that must be satisfied before this use case can be invoked

Post-conditions

The conditions that will be established as a result of invoking this use case sucessfully

Page 9: Lecture05

Use-Case Template Example

Part 2

Al-Tamimi 2011 © 9

Flow of events A step-by-step description of the interactions between the actor(s) and the system, and the functions that must be performed in the specified sequence to achieve a user goal

Alternative flows and exceptions

Major alternatives or exceptions that may occur in the flow of events

Priority The development priority of this use case

Non-behavioral requirements

The non-functional requirements of the system such as hardware and software platform requirements, performance, security, … etc

Assumptions All the assumptions made about the use case

Issues All outstanding issues regarding the use case

Source Reference materials relevant to the use case

Page 10: Lecture05

Use-Cases Prioritization

• The following factors typically increase the priority ranking of a use case:– Architectural significance of the use case– Use of new and untested technologies– Problems which require substantial

research effort– Great improvement in efficiency (or

revenue) of the business process; and– Use cases that support major business

processes

Al-Tamimi 2011 © 10

Page 11: Lecture05

Al-Tamimi 2011 © 11

Business Workflow Analysis

Problem Statement

ATM

Withdraw Money

Deposit Money

Check Balance

Customer

Use CaseAnalysis

Withdraw Money

Prcess ExcessLimit

*

*

Use Model

Structuring Use Cases

Domain Analysis

Login Account

<<include>>

<<extend>>

Test CasesBehavioralModeling(See NextChapter)

Develop Use CaseDescription

TextualAnalysis

DomainClass Model

Use Case Description

BriefDescription

Flow ofEvents

InstanceScenario

(SucessfullyWithdraws$250.00)

Grouping Use CaseInto Packages

Page 12: Lecture05

Packages

• Packages should be used where appropriate to make the use-case diagram more easily understood

• Use cases that form a natural grouping should be organized into packages

Al-Tamimi 2011 © 12

Page 13: Lecture05

• Developing an initial use case model1. Developing the problem statement2. Identifying the major actors and use-cases3. Creating an initial use-case diagram4. Describing briefly the use-cases (with initial

descriptions)5. Identifying/refining candidate business (domain)

classes using textual analysis• Refining the use case model

1. Developing base use-case descriptions2. Structuring Use-Cases : Iteratively elaborating on the

base use-case descriptions and determining the extend, include and generalization relationships

3. Developing instance scenarios4. Prioritizing use-cases

Al-Tamimi 2011 © 13

Developing Use-Cases Steps

Page 14: Lecture05

Developing An Initial Use-Case Model

14

1. Developing the problem statement2. Identifying the major actors and use-cases3. Creating an initial use-case diagram4. Describing briefly the use-cases (with initial descriptions)5. Identifying/refining candidate business (domain) classes

using textual analysis

Page 15: Lecture05

Step 1: Developing the Problem Statement

• The chief executive officer of a mail order company is interested in computerizing the company’s business process in order to improve operational efficiency. The major business activities of the company can be briefly described as follows:– A customer registers to become a member by

filling in the membership form and mailing it to the company. A member who has not been active (no transactions) for a period of one year will be removed from the membership list and he/she needs to apply for reinstatement of the lapsed membership

Al-Tamimi 2011 © 15

Page 16: Lecture05

Step 1: Developing the Problem Statement

– A member should inform the company of any change in personal details, such as home address, telephone numbers, etc

– A member can place an order by filling out a sales order form and faxing it to the company or by phoning the Customer Service Assistant with the order details

– The Customer Service Assistant checks the validity of membership and then enters the sales order information into the system

Al-Tamimi 2011 © 16

Page 17: Lecture05

Step 1: Developing the Problem Statement

– The Order Processing Clerk checks the availability of the ordered items and, if they are available, holds them for the order. When all the ordered items are available, the Order Processing Clerk will schedule their delivery.

– The Inventory Control Clerk controls and maintains an appropriate level of stock and is also responsible for acquiring new items.

Al-Tamimi 2011 © 17

Page 18: Lecture05

Step 1: Developing the Problem Statement

– If there is a problem with an order, the member will phone the Customer Service Assistant, who will then take appropriate action to follow up the particular sales order

– Members may return defective goods within 30 days and get their money back

– The system will record the name of the staff member who handles the transaction for future follow up action

Al-Tamimi 2011 © 18

Page 19: Lecture05

Step 2-a: Identifying the Major Actors

• Actors from the client point of view:– Customer Service Assistant– Order Processing Clerk– Inventory Control Clerk

• Actor Specification:

Al-Tamimi 2011 © 19

Actor name: Order Processing Clerk

Description: The Order Processing Clerk is responsible for processing sales orders, submitting reorder requests, requesting necessary deposits from members and scheduling the delivery of the goods to members

Page 20: Lecture05

Step 2-b: Identifying the Use-Cases

• The following questions may be useful in collecting information from users:– What are the main tasks carried out by

each actor?– What data are manipulated and processed

by the system? – What problems is the system going to

solve? – What goals does an actor want to achieve

using the system?– What are the major problems with the

current system and how could the proposed system simplify the work of the user?

Al-Tamimi 2011 © 20

Page 21: Lecture05

Step 2-b: Identifying the Use-Cases

1. Check order status2. Place order3. Handle goods return4. Update membership record5. Archive membership6. Register new member7. Process order8. Schedule delivery9. Order goods10.Receive goods11.Deliver goods

Al-Tamimi 2011 © 21

Page 22: Lecture05

Step 3: Creating an initial use-case diagram

Al-Tamimi 2011 © 22

Page 23: Lecture05

Step 4: Describing briefly the Use-Cases

• An Initial Use Case Description of the Schedule Delivery Use-Case:

Al-Tamimi 2011 © 23

Use case: Schedule Delivery

Use case ID: UC-300

Actor: Order Processing Clerk

Description: The Order Processing Clerk selects an order from the list of filled sales orders. The system displays the sales order details, and the member’s telephone number and address are displayed. The Order Processing Clerk enters the delivery date and time after talking with the member over the phone. The system records the delivery date and time in a dispatch request to the delivery team.

Page 24: Lecture05

Step 4: Describing briefly the Use-Cases

• An Initial Use Case Description of the Check Order Status Use-Case:

Al-Tamimi 2011 © 24

Use case: Check Order Status

Use case ID: UC-400

Actor: Customer Service Assistant

Description: The Customer Service Assistant enters the ID of the member. The Customer Service Assistant selects a sales order of the member. The system displays the status of the sales order.

Page 25: Lecture05

Step 5: Identifying/refining candidate business (domain) classes using textual

analysis• To identify the objects and classes, perform a

textual analysis to extract all nouns and noun phrases from the problem statement

• The following categories are more likely to represent objects:– Tangible things (e.g. classroom, playground)– Conceptual things (e.g. course, module)– Events (e.g. test, examination, seminar)– Outside organizations (e.g. publisher, supplier)– Roles played (e.g. student, teacher, principal)– Other systems (e.g. admission system, grade

reporting system)

Al-Tamimi 2011 © 25

Page 26: Lecture05

Step 5: Identifying/refining candidate business (domain) classes using textual

analysis

Al-Tamimi 2011 © 26

Use case: Schedule Delivery

Use case ID: UC-300

Actor: Order Processing Clerk

Description: The Order Processing Clerk selects an order from the list of filled sales orders. The system displays the sales order details, member’s telephone number and address. The Order Processing Clerk enters the delivery date and time after talking with the member over the phone. The system records the delivery date and time in a dispatch request to the delivery team.

Page 27: Lecture05

Step 5: Identifying/refining candidate business (domain) classes using textual

analysis

Al-Tamimi 2011 © 27

Page 28: Lecture05

Refining the Use-Case Model

28

1. Developing base use-case descriptions2. Structuring Use-Cases : Iteratively elaborating

on the base use-case descriptions and determining the extend, include and generalization relationships

3. Developing instance scenarios4. Prioritizing use-cases

Page 29: Lecture05

Basic Flow

• List the basic events that will occur when this use case is executed

• Include all the primary activities that the use case will perform

• Be fairly descriptive when defining the actions performed by the actor and the response of the use case to those actions

• This description of actions and responses are your functional requirement

• This will be the basis for writing the test case scenarios for the system

Al-Tamimi 2011 © 29

Page 30: Lecture05

Alternative Flow

• Any subsidiary events that can occur in the use case should be listed separately

• Each such event should be completed in itself to be listed as an alternative flow

• If there are too many alternatives flows, you need to revisit your design to make it simpler, or break the use case into smaller units

Al-Tamimi 2011 © 30

Page 31: Lecture05

Alternative Flow

• One way to look at it they are really all the same thing by different names: – Optional flows implies that the behavior

is optional and doesn't always need to be performed

– Alternative flows implies some sort of alternative decision is taken

– Exception flows implies that something other than the ordinary has occurred

Al-Tamimi 2011 © 31

Page 32: Lecture05

Basic vs. Exception vs. Alternative Flows

• Basic Flow is the normal flow of action in an application. For example, in the login page after entering user name and password the next screen should appear is the basic flow

• Exception flow are the activities in case of the exception thrown. They are the flow of events which will happen in case of the error

• Alternate flow are the alternative actions that can be performed. For example in the login page the alternative flow will be checking the existence of the user name entered

Al-Tamimi 2011 © 32

Page 33: Lecture05

Basic vs. Alternative Flow

Al-Tamimi 2011 © 33

Page 34: Lecture05

Basic vs. Alternative vs. Exception Flows

Al-Tamimi 2011 © 34

Basic Flow

Alternate Flow 1

Alternate Flow 2Alternate Flow

3

Alternate Flow 4

Exception Flow 1

Exception Flow 2Exception Flow 3

Page 35: Lecture05

Step 1: Developing base use-case descriptions

Al-Tamimi 2011 © 35

Use case name

Place Order

Use case ID UC-100

Super use case

The name of the generalized use case to which this use case belongs.

Actor(s) Customer Service Assistant

Brief description

A Customer Service Assistant places an order and then submits it for processing.

Preconditions The member must have registered with the system.

Post-conditions

The Customer’s order will be directed to the order processing department for processing.

Page 36: Lecture05

Step 1: Developing base use-case descriptions

Al-Tamimi 2011 © 36

Flow of events 1.The Customer Service Assistant finds the member’s record by entering the member’s ID or name. The system displays a list of members which match the information entered by the Customer Service Assistant. 2.The Customer Service Assistant selects the required member record. The system displays the details of the member.3.The Customer Service Assistant selects “Place Order”. A new order form and order ID are then generated and displayed. 4.The Customer Service Assistant selects items from the catalog and adds them to the order. 5.The Customer Service Assistant submits the order for processing. The system records the order and forwards it to the Order Processing Clerk.

Page 37: Lecture05

Step 1: Developing base use-case descriptions

Al-Tamimi 2011 © 37

Alternative flows and exceptions

At any time the Customer Service Assistant can decide to suspend the ordering process and come back to it later, or to cancel the order.

Priority High

Non-behavioral requirements

The system should be able to handle 20,000 new orders per day.

Assumptions

Issues Is there any limit on the amount of an order?

Source User Interview Memo 21, 8/9/01

Page 38: Lecture05

Step 2: Structuring Use-Cases

Al-Tamimi 2011 © 38

Page 39: Lecture05

Step 2: Structuring Use-Cases

Al-Tamimi 2011 © 39

Use case name

Place Order

Use case ID UC -100

Super use case

Actor(s) Customer Service Assistant

Brief description A Customer Service Assistant places an order and then submits it for processing.

Preconditions The member must have registered with the system.

Post-conditions The Customer’s order will be directed to the order processing department for processing.

Flow of events

1.Include (Find Member Record).2.The Customer Service Assistant selects “Place Order”. A new order form and order ID are then generated and displayed. 3.The Customer Service Assistant selects items from the catalog and adds them to the order. 4.The Customer Service Assistant submits the order for processing. The system records the order and forwards it to the Order Processing Clerk.

Page 40: Lecture05

Step 2: Structuring Use-Cases

Al-Tamimi 2011 © 40

Use case name Find Member Record

Use case ID UC-10

Brief description

A member record is requested.

Post-conditions

A membership record is returned.

Flow of events 1.The Customer Service Assistant finds the member record by entering the member’s ID or name. The system displays a list of members which match the information entered by the Customer Service Assistant. 2.The Customer Service Assistant selects the required member record. The system then displays the details of that member.

Alternative flows and exceptions

No member record is found for the customer.

Page 41: Lecture05

Step 3: Developing Instance Scenarios

• A use case specifies all possible ways of using a system functionality to achieve a user goal

• Sometimes, it is necessary to write some examples (instance scenarios) to illustrate the execution of a complex use case

• Instance scenarios are easier for the user to understand, and they are very useful for clarifying any ambiguity in the use case description

• The instance scenarios can also serve as test cases for system testing

Al-Tamimi 2011 © 41

Page 42: Lecture05

Step 3: Developing Instance Scenarios

Al-Tamimi 2011 © 42

Parent use case name

Place Order

Parent use case ID

UC-100

Instance name A sales order form is received but the membership number is missing.

Instance ID UCIS-100-1

Environmental conditions and assumptions

The name (Peter Chan) and signature of the member are available in the system.

Inputs A sales order form

Page 43: Lecture05

Step 3: Developing Instance Scenarios

Al-Tamimi 2011 © 43

Instance flow description

The Customer Service Assistant enters “Peter Chan” to find the member record. The system then displays a list of members which match the member’s name. The Customer Service Assistant repeatedly selects a member record. The system displays the signature of the member when a member record is selected. The Customer Service Assistant selects “Place Order”. A new order form and order ID are then generated and displayed. The Customer Service Assistant selects items from the catalog and adds them to the order. The Customer Service Assistant submits the order for processing. The system records the order and forwards it to the Order Processing Clerk.

Outputs The sales order is placed.

Page 44: Lecture05

Step 4: Prioritizing Use-Cases

Al-Tamimi 2011 © 44

Priority Rank

Use Case Reason

High Process Order Directly improves the efficiency of the business process and affects the system architecture.

High Place Order Same as above

High Find Member Record

Included as part of the Place Order use case.

Medium Order Goods Ordering goods is less often than processing order but still is one of the major business processes.

Medium Deliver Goods Can improve the control of stock level.

Low Update Membership Record

Small impact on the system architecture.

Low Register New Member

Same as above.

Page 45: Lecture05

Resources

• Object Oriented Technology, By Tsang chapter 3

• Tsang slides• Chapter 6, Applying UML and

Patterns

Al-Tamimi 2011 © 45