Use case diagrams, decision tables

Transkrypt

Use case diagrams, decision tables
Use case diagrams,
decision tables
dr Tomasz Ordysiński
Definition


A use case diagram is a type of behavioral
diagram defined by the Unified Modeling Language
(UML). Its purpose is to present a graphical
overview of the functionality provided by a system in
terms of actors, their goals (represented as use
cases), and any dependencies between those use
cases.
Use case diagram we can find several elements: :
- use cases
- actors
- relations
- system boundaries (optional)
Connection with scenarios

Use case diagrams are strongly connected witeh
scenarios. Scenario is an example what is
happening when someone or something interacts
with a system. An example of scenario for medical
clinic:
„patient calls to clinic to make appointment for annual
healtjh check. The receptionist finds the nearest free date
in appointments book and books it for a patient."

Use case is a summary of scenarios of one task
or goal.
Actor

An actor is someone or something which initiates events
connected with specific task. Actor describes a role of human
or object. THe picture below shows a case use „Determining a
term of control visit in medical clinic”. An actor is a patient.
Connection between an actor and case use is a
communication.
Comminication
Actor
Determinig the term
Patient
Case use
Example 1

Actors are represented by human figure. Use cases are
represented by ovals. Communication is a line connecting
actors and use cases. Use case diagram is a set of actors,
use cases and communication lines. An examlpe shows 4
actors with 4 use cases. Notice that one use case can have
many actors.
Visit cancellation
Appointment’s book
Determinig the term
Patient
Order for doctor
Doctor
Bill payment
Secretary
Example 2

Video cassete rental
Customer rents and returns video cassettes asking the employee to do
those actions. An employee calculates a fee in case of returning the
cassette after proper term and can add new or remove wasted cassettes.
Customer using Internet can browse video catalog and book chosen
cassettes.
Adding new cassette
Removal of wasted
cassette
Employee
Cassette rental
Catalog browsing
Customer
Receiving returned
cassette
Fee calculation
Booking a cassette
Searching for
cassette
Example 3

Cash dispenser
Cash dispenser enables customer to withdraw money. To do so customer
inserts a card, determines the amount of money, takes money and card.
Customer can also check the available amount on his account. Once a
while cash dispenser is replenished by service employee with money.
Inserting a card
Money replenishing
Typing the amount
Money
withdrawing
Taking out the card
Service
employee
Customer
Checking
The account
Taking money
Example 4
A system boundary rectangle separates the
clinic system from the external actors.
A use case generalization shows that one
use case is simply a special kind of another.
Pay Bill is a parent use case and Bill
Insurance is the child. A child can be
substituted for its parent whenever
necessary. Generalization appears as a line
with a triangular arrow head toward the
parent use case.
Include relationships factor use cases into
additional ones. Includes are especially
helpful when the same use case can be
factored out of two different use cases. Both
Make Appointment and Request
Medication include Check Patient Record
as a subtask. In the diagram, include
notation is a dotted line beginning at base
use case ending with an arrows pointing to
the include use case. The dotted line is
labeled <<include>>.
An extend relationship indicates that one
use case is a variation of another. Extend
notation is a dotted line, labeled <<extend>>,
and with an arrow toward the base case. The
extension point, which determines when the
extended case is appropriate, is written
inside the base case.
When used?

Use case diagrams are used in 3 cases:



Requirements definition. New use cases very often generates
new requirements while system is analyzed.
Communication with customers. Simple form of this diagram is a
good communication way between programmers and cutomers.
Generic of test cases. Set of scenarios can suggest the way of
testing this scenarios.
Decision table



Decision table is a structure of
set of connected decision rules
description.
Decision rule is an expression
describing set of conditions
which must be fulfilled to
execute a set of activities.
Symbols for conditions:




Y – condition must be fulfilled,
N – condition must not be
fulfielled ,
empty - condition unimportant.
Symbols for processes:


X – necessary process
empty - process can be ignored.
CONDITIONS:
Scenarios N/T
Condition 1
N
N
N
N
N
N
N
N
T
T
T
T
T
T
T
T
T
Condition 2
T
T
T
T
T
T
T
T
N
N
N
N
N
N
N
N
N
Condition 3
N
N
N
N
N
N
N
N
T
Condition 4
T
T
T
T
T
T
T
T
N
Condition 5
N
N
N
N
N
T
T
T
N
N
N
N
N
T
T
T
Condition 6
T
T
T
T
T
N
N
N
T
T
T
T
T
N
N
N
PROCESSES:
What shpould be done? (X)
process 1
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
process 2
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
process 3
X
X
X
X
X
X
X
X
X
X
X
X
process 4
X
X
X
X
X
X
X
X
X
X
X
X
process 5
X
X
X
X
X
X
X
X
X
X
X
X
process 6
X
X
X
X
X
X
X
X
X
X
X
X
process 7
X
X
X
X
X
X
X
X
X
X
X
X
process 8
X
X
X
X
X
X
X
X
X
X
X
X
process 9
X
X
X
X
X
X
X
X
X
X
process 10
WARUNKI:
mamy wolny termin (zgodny z wymaganiami klienta)
N
N
N
N
N
N
N
N
T
T
T
T
T
T
T
T
T
nie mamy wolnego terminu (zgodnego z oczekiwaniami klienta)
T
T
T
T
T
T
T
T
N
N
N
N
N
N
N
N
N
klient jest skłonny poczekać
N
N
N
N
N
N
N
N
T
klient nie czeka
T
T
T
T
T
T
T
T
N
klient zamawia dodatkowe usługi
N
N
N
N
N
T
T
T
N
N
N
N
N
T
T
T
klient nie jest zainteresowany dodatkowymi usługami
T
T
T
T
T
N
N
N
T
T
T
T
T
N
N
N
klient wpłaca zaliczkę
N
N
N
N
T
N
N
T
N
N
N
N
T
N
N
T
N
T
T
N
T
T
T
T
N
T
T
N
klient nie wpłaca zaliczki
potwierdzenie wykonania usług zewn. w terminie
N
N
T
T
N
N
T
T
zlecenia “Charona” nie zostaną wykonane w terminie
T
T
N
N
T
T
N
N
klient wpłaca resztę zapłaty
N
T
N
T
N
T
N
T
N
T
N
T
klient nie wpłaca reszty zapłaty
T
N
T
N
T
N
T
N
T
N
T
N
przedstawienie możliwości realizacji
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
uzgodnienie konkretnych warunków zlecenia (kosztorys)
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
pobranie zaliczki
X
X
X
X
X
X
X
X
X
X
X
X
wystawienie upoważnienia do odebrania zwłok
X
X
X
X
X
X
X
X
X
X
X
X
uzupełn. zbioru upoważnień
X
X
X
X
X
X
X
X
X
X
X
X
wystawienie pokwitowania
X
X
X
X
X
X
X
X
X
X
X
X
uzupełn. zbioru zleceń do wykonania (1)
X
X
X
X
X
X
X
X
X
X
X
X
uzupełn. zbioru ewidencji wpłat (1)
X
X
X
X
X
X
X
X
X
X
X
X
zlecenie usług firmom współpracującym
X
X
X
X
X
X
X
X
X
X
PROCESY:
zwrócenie się do innych firm świadczących usługi niezbędne do zreal. zlecenia
wypisanie zlecenia dla firmy zewn.
X
X
X
X
X
X
X
X
uzupełnienie zbioru instytucji wykonujących zlecenia dla "Charona" (1)
X
X
X
X
X
X
X
X
podział zadań dla pracowników
X
X
X
X
X
X
X
X
X
X
X
X
transport zwłok do firmy
X
X
X
X
X
X
X
X
X
X
X
X
przygot. zmarłego do pochówku
X
X
X
X
X
X
X
X
X
X
X
X
pogrzeb
X
X
X
X
X
X
X
X
X
X
X
X
potwierdzenie wykonania usługi
X
X
X
X
X
X
X
X
X
X
X
X
uzupełn. zbioru instytucji wykonujących zlecenia dla "Charona" (2)
X
X
X
X
X
X
X
X
Task


Task 1
prepare use case diagram for car garage which
offers current repairs and periodic inspections.
Task 2
Prepare simple decision table containing condition
and processes for awarding a student with
scholarship.