OOUML
OOUML
December, 2001
OO/UML 2
Contents
Part 2
UML Overview
December, 2001
OO/UML 4
UML
UML Diagrams
User-System Logical structure
interaction State
State
Diagrams
Object interaction Class
Diagrams
Use Case Diagrams
Use Case
Diagrams State
Use Case Use Case
Diagrams State
Diagrams
Use Case Diagrams Object
Diagrams
Diagrams
Sequence Diagrams
Diagrams
Diagrams
Scenario State
Scenario
Diagrams State
Diagrams
Collaboration
Diagrams Models Component
Diagrams
Diagrams Diagrams
Implementation
Scenario Component structure
Scenario
Diagrams
Component
Diagrams
Deployment
Activity
Diagrams Diagrams
Diagrams Diagrams
Statechart
Diagrams
Dynamic
DynamicView
View Static View
Object behavior
OO/UML 6
4+1 Views
Concepts Topology
Relations Usage Distribution
Behavior Delivery
Performance Packaging
Scalability Versioning
Throughput Assembly
OO/UML 7
Contents
• UML History
• UML Diagrams
• UML Language Specification
OO/UML 8
Part 3
December, 2001
OO/UML 9
Contents
Contents
Contents
Each lift cage contains a set of buttons corresponding to the available floors. These are called Floor Request
Buttons. Once pressed the Floor Request Buttons will be back-lit to indicate that a request is pending. When the lift
arrives at a floor for which a request is pending, the back light of the corresponding button is switched off, the chime
inside the cage sounds and the doors open. Again the Floor Request Buttons are enabled for receiving new requests
when the back light is off.
Each lift cage has two sliding half doors that match two sliding half doors for that shaft at each floor. At a particular
floor these doors will open and close simultaneously, the floor doors being coupled to the cage doors by mechanical
means. When the doors open a closure timeout period starts. When this period expires the doors start closing. If an
obstruction is detected in the doorway after expiration of the timeout period, the doors open completely and the
closure timeout period is restarted. The lift cage can only start its motor and move to another floor when doors are
completely closed. In each cage there are two extra buttons for opening and closing the doors. The button for
opening the door will cause the doors to open but only when the lift is still at a floor and has not started moving. The
door closure timeout period is reset. Pressing the close button will have the same effect as ending the door closure
timeout period. The doors start to close but open again if an obstruction is detected.
The floor requests and lift requests are serviced in a way that guarantees optimal transportation of people. Since the
criteria for optimal control may change depending on circumstances the allocation of lifts to requests must flexible
and adaptive
OO/UML 15
Classification of Nouns
Problem related nouns General Actors
lift system signal obstruction
lift paragraph people
shaft means
building period
floor
motor control
button expiration
lift request buttons circumstance
floor request buttons allocation
close button
open button
button light (back light)
chime
cage door
floor door
closure time
request
floor requests
lift requests
OO/UML 16
Aggregations
Building
1
LiftSystem
10
8
Floor
floorNumber : int Shaft
8 1 Motor
FloorDoor CageDoor LiftCage
raise()
lower()
LiftRequestButton 10 2 1
pressed : boolean
DoorDetector FloorRequestButton DoorButton Chime
sound()
1 1
ButtonLight
on()
off()
OO/UML 17
Associations
Building
RequestLiftUp 0..1 1
LiftSystem
RequestLiftDown
0..1
10
*
Floor 8
8 * 1 Motor
FloorDoor Door CageDoor LiftCage
raise()
1 1
Door lower()
2 open()
close()
LiftRequestButton
10 2 1
pressed : boolean
FloorRequestButton DoorButton Chime
DoorDetector
sound()
1 1
ButtonLight
on()
off()
OO/UML 18
Contents
• The Use Cases describe the functions to be performed by the system from the
perspective of certain actors
• The Use-Cases capture the requirements and help to trace the realization of the
requirements during development
OO/UML 20
Actor
• An actor is a role played by an object outside of a system that interacts directly
with the system
• A single object may play several roles and therefore be represented by several
actor symbols in the model
• Actors either actively or passively participate in one or more Use-Cases
Staff Visitor
OO/UML 21
Use Case
ChangeFloor
OO/UML 22
Document Sections
1. Use Case Name
1.1 Brief Description
2. Flow of Events
2.1 Basic Flow
2.2 Alternative Flows
2.3 Exceptional Flows
4. Pre-Conditions
4.1 < Pre-condition One >
5. Post-Conditions
5.1 < Post-condition One >
6. Extension Points
6.1 <name of extension point>
OO/UML 24
Extensions
Put here there extensions, one at a time, each referring to the step of the main scenario.
<step altered> <condition>: <action or sub-use case>
<step altered> <condition>: <action or sub-use case>
Related Information
<whatever your project needs for additional information>
OO/UML 25
Relationships
ChangeFloor
Visitor
– The use case triggers the actor
VerifyCard
Bank
OO/UML 28
Use-Case Relationships
• Use Case are related through dependencies. There are two standard
dependency-stereotypes:
– An include dependency from Use Case A to Use Case B indicates that the Use
Case A refers to and includes the behaviour as specified by B
• This is used to separate often occurring sub-Use-Cases
<<include>>
ChangeFloor ExitLiftCage
– An extend relationship from Use Case A to Use Case B indicates that the Use Case
B may optionally be extended with the behaviour specified by A. The description of B
does not refer to A, A refers to B and indicates at what extension point it is to be
inserted in A
• This is used to separate important optional parts of a Use-Case that are best described
separately
<<extend>>
ExitLiftCage OpenDoor
OO/UML 29
Include
• An include relationship between two Use Cases means that the base Use Case
explicitly incorporates the behavior of another Use-case at a location specified in
the base Use Case
– Used to avoid describing the same flow of events several times
– Used when similar behavior recurs across more than one use case
<<include>>
RequestLiftCage
<<include>>
ChangeFloor
Extend
• An “extend” relation between Use Cases means that the base Use Case may
incorporate the behavior of the extension Use Case at the extension point(s)
defined in the base Use Case but only if the possible condition is fulfilled
– An extension Use-case is not necessarily a separately executable Use Case.
Extension Points
a1 <<extend>>(a1)[condition]
C
Base use case
Use-Case Relationships
Pay
Example UCD
system name
actor
use case
actor-use case
communication
system boundary
OO/UML 34
Part of a Model
Request
<<extend>> Catalog
Place
Order
<<include>>
<<include>>
<<include>>
Arrange
Payment
Supply
Customer Order
Data Product
Pay Arrange
Cash Credit
OO/UML 35
Use-Case Modeling
• Steps:
– Find the actors
– Define the main Use Cases
– Look for sub-Use-Cases
– Find the Use-Case relationships
– Describe each Use Case in a Use-Case Specification document
OO/UML 36
• Which people or systems are interacting with the system in one way or
another
– Which user employ the system’s most obvious main functions
– Which users employ the secondary functions, such as system maintenance
and administration?
• Doctor
• Nurse
• Warden
• Lift mechanic
Visitor Patient
Staff
OO/UML 38
• For each Actor that has been identified ask the following questions:
– What are the primary tasks that the Actor wants the system to perform?
– Will the Actor create, store change, remove or read data in the system?
– Will the Actor need to inform the system about sudden, external changes?
– Does the Actor need to be informed about certain occurrences in the
system?
• Name each Use Case in the list and define its scope
• Exercise: name some Use Cases for the hospital-lift case for each
identified actor
OO/UML 40
Request Close
<<extend>>
<<include>> <<include>>
Arrive At Floor
<<extend>>
<<extend>> <<extend>>
• Review the Use-case model against the Stakeholder Requests and the Vision
OO/UML 43
• Setting priorities may help select the Use Cases that should be addressed in
each iteration
– The degree of support of the architecture for extensibility can be “tested” by adding
Use Cases in later iterations
OO/UML 44
insert card
verify card
verify account
account not ok
reject card
remove card
OO/UML 45
visit(i)
visit(floor1)
setDestination(floor1)
justBelow(floor1)
arriveAt(floor1)
open( )
allocateCage()
visit(floor1)
setDestination(floor1)
justBelow(floor1)
arriveAt(floor1)
open( )
Building
1 10
RequestedLiftUp
LiftSystem 0..1 Floor
*
floorNumber : int
visitUp() *
0..1
visitDown() RequestedLiftDown
*
8 * RequestedToServiceFloor
LiftCage
2
visit()
LightedButton
arriveAt() 10
doorIsClosed()
clear()
press()
OO/UML 50
LiftSystem liftRequestUpButton
floor : int LightedButton
*
LiftCage floor : int
currentFloor
visit()
arriveAt()
doorIsClosed()
OO/UML 51
Requesting Lift
liftRequestUpButton[i] : Door : LiftSystem : LiftCage : Motor
: LightedButton
: Person
press( )
visitUp(i)
allocateCage()
visit(i)
setDestination(i)
justBelow( )
arriveAt(i)
open( )
Go To Destination Floor
: Door floorRequestButton[j] : : LiftCage : Motor
LightedButton
: Person
press( )
visit(j)
setDestination(j)
Close()
doorIsClosed ()
raise( )
justBelow( )
arriveAt(j)
open( )
*
LiftSystem liftRequestUpButton
floor : int LightedButton