Académique Documents
Professionnel Documents
Culture Documents
UML
or
UML in an Hour
(more or less)
Copyright 2000 by RWD Technologies Inc.
All Rights Reserved
03/31/15
Objectives
Upon successful completion of this
03/31/15
03/31/15
Class Diagrams
Are the most fundamental UML Diagram.
Describe the classes in the system, and the
03/31/15
Rental Invoice
Rental Item
{abstract}
1..*
0..1
1
DVD Movie
03/31/15
VHS Movie
Video Game
Checkout Screen
Multiplicity
Simple
Aggregation
Rental Invoice
Abstract
Class
Rental Item
{abstract}
1..*
0..1
Composition
DVD Movie
03/31/15
Simple
(Dependency)
Generalization
VHS Movie
Video Game
Association
Checkout Screen
Customer
Relationship
Rental Invoice
Dependent
class
Rental Item
Generalization
(cluster)
Multiplicity/
Base class
Cardinality
is abstract
DVD Movie
Checkout Screen
VHS Movie
03/31/15
Video Game
Parts of a Class
Classes can have four parts
Name
Attributes
Operations
Responsibilities
Classes can show visibility
and types.
All parts but the Name are
optional.
03/31/15
MyClassName
+SomePublicAttribute : SomeType
-SomePrivateAttribute : SomeType
#SomeProtectedAttribute : SomeType
+ClassMethodOne()
+ClassMethodTwo()
Responsibilities
-- can optionally be described here.
Object Diagrams
An Object is an instance of a
class.
Object names are underlined.
Object diagrams are similar to
class diagrams. Many of the
same notations are used.
Object diagrams capture
instances of classes, and allow
the dynamic relationships to
be shown.
03/31/15
ThisOne : MyClassName
+SomePublicAttribute : SomeType
-SomePrivateAttribute : SomeType
#SomeProtectedAttribute : SomeType
+ClassMethodOne()
+ClassMethodTwo()
10
Class Name
Customer
+id:integer
+name:string
Rental Item
Rents
0..1
0..n +id:integer
+released:date
Class Diagram
Attributes
Object Name
Joe: Customer
Casablanca: Movie
+id:1667
+name:Joe Smith
+id:22340
+released:1942
Object Diagram
03/31/15
11
Tagged Value
Stereotype
RentalContract
<<persistent>>
{version=1.1}
ListOfRentedItems
Customer
{ordered
by title}
Constraint
03/31/15
12
Use Cases
Describe interactions between users and
03/31/15
13
Identify Movie
Customer
Open Account
Clerk
Return Movie
In-Store
Customer
03/31/15
Telephone
Customer
Review
Account Status
14
provides documentation
for the Use Case.
A Use Case is not
complete without the
report.
The elements of the Use
Case Report are shown
on the right.
03/31/15
Brief
Brief description
description
Precondition
Precondition
Flow
Flow of
of events
events
Main
Main flow
flow
Subflows
Subflows
Alternate
Alternate flows
flows
Postcondition
Postcondition
Special
Special Requirements
Requirements
Enclosures
Enclosures
Diagrams
Diagrams
Pictures
Pictures of
of the
the UI
UI
15
Includes
includes
Customer
Search Movie
Database
Find Items
by Actor
Stereotype
Extends
extends
Clerk
03/31/15
Check In
Movie
Assess
Late Fees
16
Collaboration Diagrams
Collaboration diagrams describe object
03/31/15
17
1: enter_customer()
3: enter_movies()
Object
5: add(customer, movies)
8: generateRentalTotal()
2: IsValidCust(CustId)
7: print invoice()
:Check-out
Manager
:Customer
:Clerk
4:GetMovieByBarcode()
:Inventory
03/31/15
Message
18
Sequence Diagrams
Can be morphed from Collaboration Diagrams.
Describe interactions between objects arranged in time
sequence
Focus on objects and classes involved in the scenario
and the sequence of messages exchanged
Associated with use cases
Used heavily during Analysis phase and are enhanced
and refined during Design phase
03/31/15
19
Cust:Customer
:Inventory
:RentedItems
Employee
1: find customer()
3: enter movie()
2: search (string)
4: search (string)
Object
Activation
Message
5: rent (movie)
6: add(Cust, item)
Lifeline
7: printInvoice()
03/31/15
8: generateRentalTotal()
20
Package Diagram
C le r k U s e r In t e r fa c e
C u s to m e r D a ta
Class
03/31/15
fa c a d e
B u s in e s s
S y s te m
C lie n t
R e n ta l S c re e n
( to b u s in e s s
s y s te m )
Package
21
Component Diagram
Component
lib r a r y
D B S e rv e r
In te rfa c e
( d b s v r . d ll)
lib r a r y
A p p lic a t io n
F ra m e w o rk
( a p p f r . d ll)
Interface
Dependency
a p p lic a t io n
V id e o
W o r k s t a t io n
( v s ta tio n .e x e )
03/31/15
Note
S u p p lie d b y
M ic r o s o f t
22
Deployment Diagram
Node
Communication
:S to re S e rv e r
Association
P h o n e C le r k T e r m in a l
:C le r k C lie n t
C h e c k O u t T e r m in a l
:C le r k C lie n t
03/31/15
S e rv e r
D B
T C P /IP
T C P /IP
S to re
S e rv e r
App
23
Activity Diagram
Start State
Identify
Caller
Action State
Obtain Name
& Address
Current
Customer?
Decision
Open
Account?
[no]
[no]
[yes]
[yes]
End State
Create
Account
03/31/15
24
Manager
Walking Clerk
Fork Point
Place
Order
Place
Order
Pay
Collect
Money
Pickup
Movie
Deliver
Movie
03/31/15
Fill
Order
Join Point
25
State Diagram
Guard
Event
Transition
[m o r e v id e o s ]
/g e t n e x t v id e o
c u s to m e r a p p e a rs
V a lid a te
d o /c h e c k
account
[a c c o u n t v a lid ]
/ g e t f ir s t v id e o
Activity
State
03/31/15
[a c c o u n t n o t
v a lid ]
C h e c k -O u t
Action
d o /c h e c k -o u t
v id e o
[ n o m o r e v id e o s ]
C h e c k -O u t
C o m p le te
26
UML Diagrams
Analysis
Design
Development
Implementation
03/31/15
27
Conclusion
UML is a robust notation that can express
03/31/15
28
Questions
03/31/15
29
30