Lecture 8 - Use Case and Activity Diagram
Lecture 8 - Use Case and Activity Diagram
Lecture # 08
2
Recap
4+1 architecture
UML Component Diagram
3
Recap
4+1 architecture
UML Activity Diagram
4
Applying 4+1 View Architecture with UML 2
5
Use Case Diagram
Use Case Diagrams
Consider an example: You recently bought a digital
camera. When you were shopping for it, you encountered a
wide variety of possibilities. How did you decide which one
to buy? You asked yourself exactly what you wanted to do
with a camera. Did you want extreme portability or did you
want a larger camera with a bigger lens? Would you be
taking distance shots? Did you want to take pictures and
post them on the web? Did you primarily want to make
prints? If so, how large? Did you want to make short
movies? With sound? We all go through a process like this
when we make a non-impulse purchase.
Use Case Diagrams
11
2. Use Case
A use case is a sequence of actions that
user takes on a system to achieve
particular goal.
Use case is a Dialogue between User
and System
Generalization
Include <<include>>
13
3. The <<extends>> Relationship
This relationship shows
Customer that one use case can
optionally add extra
behavior to another use
Place Order
case, but only under
certain conditions. It's like
saying, "This might happen
<<extends>>
sometimes.“
Make Payment
Continued
Include = Always happens (mandatory
part).
Extend = Sometimes happens (optional
or conditional).
16
3. Generalization Relationship
A generalized use case is a high-level, more abstract use case that
captures common behaviors or functionalities shared by other more
specific use cases.
Use Case Template
1
Microwave Example
Cook Food
User
Cook Food Use Case
D. Basic flow:
1. User opens door and places food in unit
2. User enters time for cooking
3. User tells microwave to start
4. Unit cooks food
5. Unit indicates it is done
Cook Food Use Case
Question 8
Cook Food Use Case
F. Pre-conditions
Unit is plugged in
Unit is in ready state
G. Post-conditions
Food is cooked or user cancelled operation
H. Special requirements
Unit should indicate remaining time to finish while cooking
Default power setting should be "high"
Microwave Inclusion
Cook Food
<<include>>
30