Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
UML Diagrams:
Outline of this Class
Activity Diagram
Notation of Activity
Diagrams
Actions
rectangle with rounded corners
meaningful name
Control flows
Add a New
Client
Assign Staff
Contact
Notation of Activity
Diagrams
Initial node
diamond
Guard conditions
black circle
Decision nodes
(and merge nodes)
in square brackets
Final node
Add a New
Client
Assign Staff
Contact
[no campaign to add]
[campaign to add]
Add New
Campaign
Notation of Activity
Diagrams
Fork nodes
and join nodes
Add a New
Client
thick bar
Actions carried
out in parallel
Add New
Campaign
Assign Staff
Contact
Notation of Activity
Diagrams
:Campaign
[Active]
Object flows
open arrow
Record completion
of a campaign
Objects
rectangle
optionally shows
the state of the
object in square
brackets
:Campaign
[Completed]
Notation of Activity
Diagrams
Campaign
Manager
Activity Partitions
(Swimlanes)
vertical columns
labelled with the
person, organisation,
department or
system responsible
for the activities in
that column
Accountant
Client
Record Completion
of a campaign
Issue invoice
Pay invoice
Record client
payment
10
11
Enter card
Enter PIN
Read card
Request PIN
[No]
Verify PIN
valid?
[Yes]
Select other
service
12
Swimlane
- partition an
activity diagram so
that parts in the
swimlane relevant
to that activities in
the partition
- helpful in
investigating
responsibilities for
interactions and
associations
between objects
and actors
13
14
15
16
State Diagrams
Statechart Diagrams
Initial state
Event
button1&2Pressed
Blink
Hours
button2Pressed
Increment
Hours
button1Pressed
Transition
button1&2Pressed
State
Blink
Minutes
button2Pressed
Increment
Minutes
button1Pressed
Blink
Seconds
Stop
Blinking
button2Pressed
Final state
Increment
Seconds
Modeling Structure
Class Diagram
21
22
24
Grace Chia:StaffMember
Carlos Moncada:StaffMember
25
Association
Client
StaffMember
staffName
companyAddress
staffContact
staffNo
staffStartDate
companyEmail
liaises with
companyFax
companyName
companyTelephone
Association name
Direction in which
name should be read
26
27
Client
companyAddress
0..* companyEmail
1
liaises with
companyFax
companyName
companyTelephone
29
Motor Vehicle
Bus
Truck
Car
30
31
class Person {
String Name;
}
class Employee extends Person
{}
class Client extends Person {}
32
Car
Engine
Seat
Wheel
33
has
34
35
Association
Generalization
Library Item
User
Borrows
No. Copies
ShelfNo
Status
Title
Issue
Return
Shelve
0..*
Address
Member#
Name
Subscribe
Unsubscribe
External Reader
Ext. Library Name
Recorded Media
Borrower
Items Borrowed
Maximum Loans
Aggregation
Book
Author
ISBN
Pub. Date
Publisher
CAL Package
Distributor
Course Text
ASSOCIATION
GENERALIZATIO
N/ INHERITANCE
PlanAnalyst
GrowingPlan
GardeningPlan
1..2
analyzes
1..*
PlanMetrics
FruitGrowingPlan
AGGREGATION/COMPOSITION
Controller
*
Light
Food
Cooler
1..23
1
Vitamin
Calorie
Heater
OOAD
37
Member
Member-Number
Member-Name
Member-Status
Member-Street-Address
Member-PO-Box
Member-City
Member-State
Member-Zip-Code
persistent
<<actor>>
Potential Member
<<actor>>
Club Member
persistent
Has
purchased
0..*
Member Ordered Product
Product
Product-Number
UPCQuantity-In-Stock
Product-Type
1
Suggested-Retail-Price
Default-Unit-Price
Current-Special-Unit-Price
Current-Month-Units-Sold
Current-Year-Units-Sold
Total-Lifetime-Units-Sold
Quantity-Ordered
Quantity-Shipped
Quantity-Backordered
Purchase-Unit-Price
Credits-Earned
Sold as
<<actor>>
Past Member
Member-Date-Of-Last-Order
Member-Daytime-Phone-Number
Member-Credit-Card-Expire-Date
Member-Credit-Card-Number
Member-Credit-Card-Type
Member-Balance-Due
Member-Bonus-Balance-Available
1..*
Audio-Category-Preference
Audio-Media-Preference
Date-Enrolled
Email-Address
Game-Category-Preference
Game-Media-Preference
Number-Of-Credits-Earned
Privacy-Code
Video-Category-Preference
Video-Media-Preference
1
persistent
0..*
Expiration-Date
binds
persistent
Transaction
Conduct
s
Transaction-Reference-Number
Transaction-Date
Transaction-Type
Transaction-Description
Transation-Amount
persistent
1..*
Places
0..*
Member Order
Sells
Merchandise
Title
Merchandise-Name
Merchandise-Description
Merchandise-Type
Unit-of-Measure
Title-Of-Work
Title-Cover
1..*
Catalog-Description
Copyright-Date
Feature
Entertainment-Company
s
Credit-Value
persistent
1
Promotion
0..*
Promotion-Number
Promotion-Release-Date
0..1
Promotion-Status
Promotion-Type
persistent
Generate
s
0..*
Order-Number
Order-Creation-Date
Order-Fill-Date
Shipping-Address-Name
Shipping-Street-Address
Shipping-City
Shipping-State
Shipping-Zip-Code
Shipping-Instructions
Order-Sub-Total
Order-Sales-Tax
Order-Shipping-Method
Order-Shipping-&-Handling-Cost
Order-Status
Order-Prepaid-Amount
Order-Prepayment-Method
persistent
Audio Tilte
Video Title
Game Title
Artist
Audio-Category
Audio-Sub-Category
Number-Of-Units-In-Package
Audio-Media-Code
Content-Advisory-Code
Producer
Director
Video-Category
Video-Sub-Category
Closed-Captioned
Language
Running-Time
Video-Media-Type
Video-Encoding
Screen-Aspect
MPA-Rating-Code
Manufacturer
Game-Category
Game-Sub-Category
Game-Platform
Game-Media-Type
Number-Of-Players
Parent-Advisory-Code
persistent
persistent
persistent
Agreement-Number
Agreement-Expire-Date
Agreement-Active-Date
Fulfillment-Period
Required-Number-Of-Credits
persistent
0..*
persistent
Agreement
persistent
persistent
Return
persistent
How to Construct
Class Diagram
Steps:
Identify object classes
Identify associations
Identify object attributes
Organize object classes using
inheritance
Describe communication using
sequence diagrams or use case
narratives
Group classes
39
:Order Entry
:Order
window
prepare()
:Order Line
:Stock Item
:Reorder
Item
:Delivery
Item
prepare()
check()
truremove()
needsToReorder()
[needsToReorder=true]
enter new
[check=true]
enter new
40
Order
OrderLine
orderNumber
date
etc
itemnumber
quantity
etc
prepare()
prepare()
ReOrderItem
itemnumber
quantity
etc
enter new()
StockItem
orderNumber
minQuantity
date
etc
needsToReorder():
boolean
DeliveryItem
is_for
deliveryadress
quantity
etc
enter new()
check(): boolean
remove()
41
Class Diagram
42
Customer
make an order
Order
Customer
*
make
44
Order
Customer
*
make
Corporate
Personal
Order
Customer
*
make
1
*
OrderLine
Product
*
Corporate
Personal
Order
orderID:char
Price:money
Customer
*
make
name:char
address:char
1
*
OrderLine
Amount:Integer
Price:money
Product
Corporate
Personal
CreditcardNo:char
billMonthly(int)
Other Diagrams
49
OOAD
Notation of
Component Diagrams
Components
in the top
Staff planner
52
Notation of
Component Diagrams
Scheduling
Provided interface
Production
scheduler
Staff planner
Planning
Notation of
Component Diagrams
PrinterDriver
port
54
Notation of
Component Diagrams
delegate
Spooling
:PrintManager
Print
Spooling
PrinterDriver
Printing
:File
55
Components
Components have changed in UML 2.0
They are no longer shown in Deployment
Diagrams, where they have been replaced
by Artefacts
Components are specifically modular
software units with well-defined interfaces
They can be logical or physical
56
57
Notation of
Deployment Diagrams
Nodes
rectangular prisms
represent processors, devices or other
resources
Communication Associations
lines between nodes
represent communication between nodes
can be stereotyped
59
Notation of
Deployment Diagrams
TCP/IP
swift:PC
node
aardvark:DECAlpha
Communication association
60
Notation of
Deployment Diagrams
Agate Client
manifest
AgateClient.jar
61
Notation of
Deployment Diagrams
PC Client
AgateClient.jar
Server
RMI
AgateServer.jar
62
Notation of
Deployment Diagrams
device
:AppServer
executionenv
:J2EEContainer
AgateServer.war
deploymentspec
serverconfig.xml
63
64
65
dependency
66
Summary
A deeper view of UML
Use case diagram
Sequence Diagram
Activity Diagram
Statechart Diagram
Class Diagram
Physical Diagrams
67
Implementation
View
Design View
Use Case
View
Process View
logical
Deployment View
physical
Additional Readings
The Elements of UML 2.0 Style, Scott W.
Ambler, Ronin International, 2005
The Object Primer 3rd Edition, Scott W.
Ambler, Cambridge University Press, 2004
UML Distilled: A Brief Guide to the Standard
Object Modeling Language (3rd Edition),
Martin Fowler, Addison-Wesley
Professional, 2004