Use Case Diagrams Damian Gordon. Example of Use Case Diagram student registration updating grades...

22
Use Case Diagrams Damian Gordon

Transcript of Use Case Diagrams Damian Gordon. Example of Use Case Diagram student registration updating grades...

Page 1: Use Case Diagrams Damian Gordon. Example of Use Case Diagram student registration updating grades output generating faculty.

Use Case Diagrams

Damian Gordon

Page 2: Use Case Diagrams Damian Gordon. Example of Use Case Diagram student registration updating grades output generating faculty.

Example of Use Case Diagram

student

registration

updatinggrades

outputgenerating

faculty

Page 3: Use Case Diagrams Damian Gordon. Example of Use Case Diagram student registration updating grades output generating faculty.

Using Use Case Diagrams

• Use case diagrams are used to visualize, specify, construct, and document the (intended) behavior of the system, during requirements capture and analysis.

• Provide a way for developers, domain experts and end-users to Communicate.

• Serve as basis for testing.• Use case diagrams contain use cases, actors, and

their relationships.

Page 4: Use Case Diagrams Damian Gordon. Example of Use Case Diagram student registration updating grades output generating faculty.

Use Case

• Use cases specify desired behavior. • A use case is a description of a set of

sequences of actions, including variants, a system performs to yield an observable result of value to an actor.

• Each sequence represent an interaction of actors with the system.

Page 5: Use Case Diagrams Damian Gordon. Example of Use Case Diagram student registration updating grades output generating faculty.

Specifying the Behavior of a Use Case

• Describing the flow of events within the use case.• Can be done in natural language, formal language or

pseudo-code.• Includes: how and when the use case starts and

ends; when the use case interacts with actors and what objects are exchanged; the basic flow and alternative flows of the behavior.

Page 6: Use Case Diagrams Damian Gordon. Example of Use Case Diagram student registration updating grades output generating faculty.

Actors

• An actor represents a set of roles that users of use case play when interacting with these use cases.

• Actors can be human or automated systems.• Actors are entities which require help from

the system to perform their task or are needed to execute the system’s functions.

• Actors are not part of the system.

name

Page 7: Use Case Diagrams Damian Gordon. Example of Use Case Diagram student registration updating grades output generating faculty.

Use Cases and Actors

• From the perspective of a given actor, a use case does something that is of value to the actor, such as calculate a result or change the state of an object.

• The Actors define the environments in which the system lives

Page 8: Use Case Diagrams Damian Gordon. Example of Use Case Diagram student registration updating grades output generating faculty.

Example of Use Case Diagram

student

registration

updatinggrades

outputgenerating

faculty

Page 9: Use Case Diagrams Damian Gordon. Example of Use Case Diagram student registration updating grades output generating faculty.

Relationships between Use Cases

1. Generalization - use cases that are specialized versions of other use cases.

2. Include - use cases that are included as parts of other use cases. Enable to factor common behavior.

3. Extend - use cases that extend the behavior of other core use cases. Enable to factor variants.

Page 10: Use Case Diagrams Damian Gordon. Example of Use Case Diagram student registration updating grades output generating faculty.

1. Generalization

• The child use case inherits the behavior and meaning of theparent use case.

• The child may add to or override the behavior of its parent.

parent

child

Page 11: Use Case Diagrams Damian Gordon. Example of Use Case Diagram student registration updating grades output generating faculty.

registration

graduateregistration

non-graduateregistration

More about Generalization

Page 12: Use Case Diagrams Damian Gordon. Example of Use Case Diagram student registration updating grades output generating faculty.

2. Include

• The base use case explicitly incorporates the behavior of another use case at a location specified in the base.

• The included use case never stands alone. It only occurs as a part of some larger base that includes it.

base included<<include>>

Page 13: Use Case Diagrams Damian Gordon. Example of Use Case Diagram student registration updating grades output generating faculty.

More about Include

• Enables to avoid describing the same flow of events several times by putting the common behavior in a use case of its own.

updatinggrades

outputgenerating

verifyingstudent id

<<include>>

<<include>>

Page 14: Use Case Diagrams Damian Gordon. Example of Use Case Diagram student registration updating grades output generating faculty.

3. Extend

• The base use case implicitly incorporates the behavior of another use case at certain points called extension points.

• The base use case may stand alone, but under certain conditions its behavior may be extended by the behavior of another use case.

base extending<<extend>>

Page 15: Use Case Diagrams Damian Gordon. Example of Use Case Diagram student registration updating grades output generating faculty.

More about Extend

• Enables to model optional behavior or branching under conditions.

Exam copy request

Exam-grade appeal

<<extend>>

Page 16: Use Case Diagrams Damian Gordon. Example of Use Case Diagram student registration updating grades output generating faculty.

Relationships between Actors

• Generalization.

student

non-graduatestudent

graduatestudent

Page 17: Use Case Diagrams Damian Gordon. Example of Use Case Diagram student registration updating grades output generating faculty.

Relationships between Use Cases and Actors

• Actors may be connected to use cases by associations, indicating that the actor and the use case communicate with one another using messages.

updatinggrades

faculty

Page 18: Use Case Diagrams Damian Gordon. Example of Use Case Diagram student registration updating grades output generating faculty.

Example

placephone call

phonenetwork

user

receivephone call

placeconference

call

receiveadditional

call

usescheduler

<<extend>>

<<extend>>

Mobile Telephone

Page 19: Use Case Diagrams Damian Gordon. Example of Use Case Diagram student registration updating grades output generating faculty.

Update Items

Bookshop Worker

Ship Order

Bookshop Manager

Update Staff Details

Register Details

Customer1

System Login

Update Customer Details

Add Items to ShoppingCart

Handle Order

<<include>>

<<extend>>

<<include>>

Make Order

<<include>>

A More Complicate Example

Page 20: Use Case Diagrams Damian Gordon. Example of Use Case Diagram student registration updating grades output generating faculty.

Example

• The system is started up when the operator turns the operator switch to the "on" position. The operator will be asked to enter the amount of money currently in the cash dispenser, and a connection to the bank will be established. Then the servicing of customers can begin.

• The system is shut down when the operator makes sure that no customer is using the machine, and then turns the operator switch to the "off" position. The connection to the bank will be shut down. Then the operator is free to remove deposited envelopes, replenish cash and paper, etc.

Page 21: Use Case Diagrams Damian Gordon. Example of Use Case Diagram student registration updating grades output generating faculty.

Example• A session is started when a customer inserts an ATM card into the card

reader slot of the machine. The ATM pulls the card into the machine and reads it. (If the reader cannot read the card due to improper insertion or a damaged stripe, the card is ejected, an error screen is displayed, and the session is aborted.) The customer is asked to enter his/her PIN, and is then allowed to perform one or more transactions, choosing from a menu of possible types of transaction in each case. After each transaction, the customer is asked whether he/she would like to perform another. When the customer is through performing transactions, the card is ejected from the machine and the session ends. If a transaction is aborted due to too many invalid PIN entries, the session is also aborted, with the card being retained in the machine.

• The customer may abort the session by pressing the Cancel key when entering a PIN or choosing a transaction type.

Page 22: Use Case Diagrams Damian Gordon. Example of Use Case Diagram student registration updating grades output generating faculty.