Professional Documents
Culture Documents
00-T4 Matthews PDF
00-T4 Matthews PDF
Terry Quatrani
UML Evangelist
Session Objectives
2
IBM Software Group
Agenda
3
IBM Software Group
Agenda
4
IBM Software Group
5
IBM Software Group
Why do we model?
! To manage complexity
! To detect errors and omissions early in the lifecycle
! To communicate with stakeholders
! To understand requirements
! To drive implementation
! To understand the impact of change
! To ensure that resources are deployed
efficiently
6
IBM Software Group
Agenda
7
IBM Software Group
8
IBM Software Group
9
IBM Software Group
10
IBM Software Group
11
IBM Software Group
Infrastructure Requirements
12
IBM Software Group
OCL Requirements
13
IBM Software Group
14
IBM Software Group
Superstructure Requirements (1 of 2)
15
IBM Software Group
Superstructure Requirements (2 of 2)
16
IBM Software Group
Language Architecture
Multiple
Multiple levels
levels of
of
compliance
compliance
! A core language + a set of optional “language units”
! Some language units have multiple “levels”
Level
Level 33
State Structured Activities Interactions Flows
Detailed
Machines Classes and
Actions
Components
Level
Level 22
MOF Profiles OCL
Level
Level 11
Basic UML
(Classes, Basic behavior, Internal structure, Use cases…)
UML Infrastructure
17
IBM Software Group
18
IBM Software Group
Agenda
19
IBM Software Group
MDA
(3)
(3) OPEN
OPEN STANDARDS
STANDARDS
•• Modeling
Modeling languages
languages
•• Interchange
Interchange facilities
facilities
•• Model
Model transformations
transformations
•• Software
Software processes
processes
•• etc.
etc.
20
IBM Software Group
etc.
etc.
21
IBM Software Group
0..1 /owner
*
/ownedE lement
DirectedRelationship /source
1..*
/target
1..*
22
IBM Software Group
Agenda
23
IBM Software Group
24
IBM Software Group
owningInstance owningSlot
InstanceSpecification Va lueS pe ci fic at ion
{subsets owner} slot * {subsets owner} val ue
Slot (from Expres sions)
1 {subsets {ordered,
0..1 *
ownedElement} subsets
ownedElement}
StructuralFeature
definingFeature (from StructuralFeatures)
classifier
Classifier
1..* (from Classifiers)
inst ance 1
ValueSpecification
(from Expressions)
Object
Object Identifier
Identifier
InstanceValue
25
IBM Software Group
Shared
Shared Behavior
Behavior
Semantics
Semantics
Different
Different Behavior
Behavior
Formalisms
Formalisms
26
IBM Software Group
Diagram Elements
! Each diagram has a frame, a content area
and a heading
! The frame is a rectangle and is used to
denote a border <kind> <name> <parameters>
!Frame is optional
! The heading is a string contained in a
name tag which is a rectangle with cut off
corners in the upper left hand corner of the
frame
!Format [<kind>] [<name>] [<parameters>]
!<kind> can be activity, class, component,
interaction, package, state machine, use
case
27
IBM Software Group
Frame Example
Package P
Class 1 Class 2
28
IBM Software Group
Use
Use Interaction
Interaction
Case
Case Diagrams
Diagrams
Diagrams
Diagrams
Activity
Activity Class
Class
Diagrams
Diagrams Diagrams
Diagrams
Deployment Composite
Composite
Deployment Structure
Diagrams
Diagrams Structure
Diagrams
Diagrams
Component
Component State
State
Diagrams
Diagrams Machine
Machine
Diagrams
Diagrams
29
IBM Software Group
Use
Use Interaction
Interaction
Case
Case Diagrams
Diagrams
Diagrams
Diagrams
Activity
Activity Class
Class
Diagrams
Diagrams Diagrams
Diagrams
Deployment Composite
Composite
Deployment Structure
Diagrams
Diagrams Structure
Diagrams
Diagrams
Component
Component State
State
Diagrams
Diagrams Machine
Machine
Diagrams
Diagrams
30
IBM Software Group
Activities
31
IBM Software Group
Activity Diagram
! Activity diagrams show flow of control and data flow
! Typically used to model
!Business process workflow
!Flow within a use case
!Business rules logic
!Functional processes
!UI screen flows
[condition 1]
[condition 3]
32
IBM Software Group
Activity Diagram
Flight Selection «post condition» Flight selected
Cancel
Enter Departure
Request Cancel
Airport
Selection
Departure List of
Select Flight
Airport Alternatives
[found > 1
flight]
Lookup City
[found 1 flight]
[found 0 flights]
33
IBM Software Group
Partitioning capabilities
Seattle Reno
OrderDepartment
Ship
Receive Fill Close
order
order order order
Company
Accounting
Send Accept
invoice payment
Invoice
Customer
Make
payment
34
IBM Software Group
Partitioning capabilities
Seattle Reno
OrderDepartment
Ship
Receive Fill Close
order
order order order
Company
Accounting
Send Accept
invoice payment
Invoice
Customer
Make
payment
35
IBM Software Group
Activity or Action
Control Join
Object Node
(may include state) Initial Node
Pin (Object)
Activity Final
Choice
Flow Final
(Simple) Join
36
IBM Software Group
B C
A Z
X Y
37
IBM Software Group
Activity 2 Activity 3
38
IBM Software Group
Actions in UML
39
IBM Software Group
ActivityNode
ActivityNode
(context)
(context)
. .
.
Action2
Action2 .
.
. .
.
. .
. .
.
Action1
Action1 .
.
.
. . .
.
.
.
Action3
Action3 .
.
Input Pin
(typed) VariableA
VariableA
Data Flow
40
IBM Software Group
Categories of Actions
41
IBM Software Group
Use
UseCase
Case Interaction
Interaction
Diagrams
Diagrams Diagrams
Diagrams
Activity
Activity Class
Class
Diagrams
Diagrams Diagrams
Diagrams
Deployment
Deployment Composite
Diagrams Composite
Diagrams Structure
Structure
Diagrams
Diagrams
Component
Component State
State
Diagrams
Diagrams Machine
Machine
Diagrams
Diagrams
42
IBM Software Group
43
IBM Software Group
Actors
Passenger Bank
44
IBM Software Group
Use Cases
45
IBM Software Group
46
IBM Software Group
Condition: {seat
Selection available on flight}
«include» Extension point: Seat Selection
Make reservation
Extension points
Seat Selection Select seat
«extend»
Passenger
Pay for Flight
Bank
47
IBM Software Group
48
IBM Software Group
Use
Use Interaction
Interaction
Case
Case Diagrams
Diagrams
Diagrams
Diagrams
Activity
Activity Class
Class
Diagrams
Diagrams Diagrams
Diagrams
Deployment Composite
Composite
Deployment Structure
Diagrams
Diagrams Structure
Diagrams
Diagrams
Component
Component State
State
Diagrams
Diagrams Machine
Machine
Diagrams
Diagrams
49
IBM Software Group
Interaction Diagrams
50
IBM Software Group
Sequence Diagram
Make reservation
Enter PIN
verify PIN(number)
valid
Destination
Destination
Show flights (destination)
51
IBM Software Group
SD Make Reservation
Make reservation
Enter PIN
verify PIN(number)
valid
Ask for destination
Destination
Destination
Show flights (destination)
52
IBM Software Group
Composite Diagrams
SD Make Reservation
SD Check PIN
: Customer reservation reservation destination
system manager
53
IBM Software Group
! Alternatives (alt)
!choice of behaviors – at most one will execute
!depends on the value of the guard (“else” guard supported)
! Option (opt)
!Special case of alternative
! Loop (loop)
!Optional guard: [<min>, <max>, <Boolean-expression>]
!No guard means no specified limit
! Break (break)
!Represents an alternative that is executed instead of the remainder
of the fragment (like a break in a loop)
54
IBM Software Group
! Parallel (par)
!Concurrent (interleaved) sub-scenarios
! Negative (neg)
!Identifies sequences that must not occur
! Assertion (assert)
!This must happen
! Critical Region (region)
!Traces cannot be interleaved with events on any of the participating
lifelines
55
IBM Software Group
ref
CheckPin
ref
DoTransaction
[else]
error(badPIN)
56
IBM Software Group
sd Reserve Flights
e fl ights
rov
1app flights :Web
m
onfir Server
1.3 c
:Web y
2 pa
Client eipt
r e c
2.1
1.1 approve
1.2 confirm flights
flights
:Flight DB
57
IBM Software Group
sd Reader {d..d+0.5}
Reading
r : Reader Idle
Read ReadDone Read
{t1..t1+0.1}
Uninitialized
Initialize
t1
58
IBM Software Group
[more]
ref
DoMore
59
IBM Software Group
60
IBM Software Group
Use
Use Interaction
Interaction
Case
Case Diagrams
Diagrams
Diagrams
Diagrams
Activity
Activity Class
Class
Diagrams
Diagrams Diagrams
Diagrams
Deployment Composite
Composite
Deployment Structure
Diagrams
Diagrams Structure
Diagrams
Diagrams
Component
Component State
State
Diagrams
Diagrams Machine
Machine
Diagrams
Diagrams
61
IBM Software Group
Class Diagram
62
IBM Software Group
Classes
63
IBM Software Group
Classes
ReservationManager
«interface»
IPerson
Mailer PassengerInterface
Reservation
Passenger
Seat Flight
CorporatePassenger
64
IBM Software Group
Operations
:ReservationManager :Reservation
Reservation
Assign seat row and position
assignSeat(row, position)
65
IBM Software Group
Attributes
66
IBM Software Group
Reservation
addItem ( )
Passenger assignSeat ( )
deleteSeat ( )
name
address
Seat Flight
CorporatePassenger row airline
position flightNumber
discount
update( )
67
IBM Software Group
Relationships
68
IBM Software Group
Relationships
69
IBM Software Group
Finding Relationships
:ReservationManager :Reservation
ReservationManager
Reservation
70
IBM Software Group
Relationships
ReservationManager
«interface»
IPerson
Reservation
addItem ( )
Passenger assignSeat ( )
deleteSeat ( )
name
address
Seat Flight
CorporatePassenger row airline
position flightNumber
discount
update( )
71
IBM Software Group
72
IBM Software Group
Multiplicity
ReservationManager
«interface»
IPerson
1
Mailer getName ( ) PassengerInterface
getAddress ( )
getName ( )
getAddress ( )
0..*
Reservation
0..* addItem ( )
Passenger assignSeat ( )
deleteSeat ( )
name 1
address
1 1
Seat Flight
CorporatePassenger row airline
position flightNumber
discount
update( )
73
IBM Software Group
Navigation
ReservationManager
«interface»
IPerson
1
Mailer getName ( ) PassengerInterface
getAddress ( )
getName ( )
getAddress ( )
0..*
Reservation
0..* addItem ( )
Passenger assignSeat ( )
deleteSeat ( )
name 1
address
1 1
Seat Flight
CorporatePassenger row airline
position flightNumber
discount
update( )
74
IBM Software Group
Inheritance
75
IBM Software Group
Inheritance
ReservationManager
«interface»
IPerson
1
Mailer getName ( ) PassengerInterface
getAddress ( )
getName ( )
getAddress ( )
0..*
Reservation
0..* addItem ( )
Passenger assignSeat ( )
deleteSeat ( )
name 1
address
1 1
Seat Flight
CorporatePassenger row airline
position flightNumber
discount
update( )
76
IBM Software Group
Realization
77
IBM Software Group
Realization
ReservationManager
«interface»
IPerson
1
Mailer getName ( ) PassengerInterface
getAddress ( )
getName ( )
getAddress ( )
0..*
Reservation
0..* addItem ( )
Passenger assignSeat ( )
deleteSeat ( )
name 1
address
1 1
Seat Flight
CorporatePassenger row airline
position flightNumber
discount
update( )
78
IBM Software Group
PassengerInterface
Mailer
getName ( )
getAddress ( ) IPerson
IPerson
PassengerInterface
Mailer
getName ( )
getAddress ( )
IPerson
79
IBM Software Group
Realization
ReservationManager
1
Mailer PassengerInterface
getName ( )
IPerson getAddress ( )
0..*
Reservation
0..* addItem ( )
Passenger assignSeat ( )
deleteSeat ( )
name 1
address
1 1
Seat Flight
CorporatePassenger row airline
position flightNumber
discount
update( )
80
IBM Software Group
81
IBM Software Group
Use
Use Interaction
Interaction
Case
Case Diagrams
Diagrams
Diagrams
Diagrams
Activity
Activity Class
Class
Diagrams
Diagrams Diagrams
Diagrams
Deployment Composite
Composite
Deployment Structure
Diagrams
Diagrams Structure
Diagrams
Diagrams
Component
Component State
State
Diagrams
Diagrams Machine
Machine
Diagrams
Diagrams
82
IBM Software Group
83
IBM Software Group
N2:Node
N2:Node
0..1
N1:Node
N1:Node Node
Node
N3:Node
N3:Node right
N4:Node
N4:Node left 0..1
84
IBM Software Group
Collaborations
! In UML 2.0 a collaboration is a purely structural concept collaboration
collaboration
!More general than an instance model
RedundantSystem
role
role associated
interaction primary
primary
get
2 a
1query 2b get
arbiter
arbiter
client
client backup1
backup1
:Arb
:Arb 2c
ge
t
connector
connector
(link
(link role)
role) backup2
backup2
85
IBM Software Group
c1/client
c1/client a/a/arbiter
arbiter d2/backup1
d2/backup1
:Client
:Client :Arb
:Arb :Dbase
:Dbase
d2/backup2
d2/backup2
:Dbase
:Dbase
86
IBM Software Group
Structured Class
Class Name
broker client
service
87
IBM Software Group
Ports
! Interaction points
! Each port is dedicated to a specific purpose and presents the
interface appropriate to that purpose
Ports
88
IBM Software Group
Port Semantics
! A port can support multiple interface specifications
! Provided interfaces (what the object can do) - incoming
! Required interfaces (what the object needs to do its job) -
outgoing
<<interface>>
«uses» «provides»
BuyTicket
Request()
TicketServer Confirm() WebClient
<<interface>> «uses»
SellTicket
«provides»
Proposal()
Confirm()
89
IBM Software Group
Provided Interface
buyTicket
WebClient
sellTicket
Required Interface
90
IBM Software Group
Customer: Agency:
WebClient TicketServer
91
IBM Software Group
loop
request
propose
confirm
confirm
92
IBM Software Group
WebClient TicketServer
«interface»
«interface» «interface»
«interface»
buyTicket
buyTicket sellTicket
sellTicket
loop request
propose
request(
request( )) Propose()
Propose()
Confirm()
Confirm() confirm Confirm()
Confirm()
confirm
customer
customer agency
agency
93
IBM Software Group
OnlineAgency
sd sd
ReserveFlights SelectFlights
Customer: Agency:
WebClient TicketServer
94
IBM Software Group
OnlineAgency
sd sd
ReserveFlights SelectFlights
Customer: Agency:
WebClient TicketServer
AirlineTicketReservation
sd sd
95
IBM Software Group
96
IBM Software Group
Use
Use Interaction
Interaction
Case
Case Diagrams
Diagrams
Diagrams
Diagrams
Activity
Activity Class
Class
Diagrams
Diagrams Diagrams
Diagrams
Deployment Composite
Composite
Deployment Structure
Diagrams
Diagrams Structure
Diagrams
Diagrams
Component
Component State
State
Diagrams
Diagrams Machine
Machine
Diagrams
Diagrams
97
IBM Software Group
98
IBM Software Group
State Diagram
state machine Make Payment
cancel
done
Display Display
Confirmation Page Cancellation Page
99
IBM Software Group
Submachine
Payment Transaction
Transaction
OK User confirmation OK Authorize not authorized
For amount transaction
OK
Authorize
PIN PIN rejected
PIN confirmed
100
IBM Software Group
Specialization
! Redefinition as part of standard class specialization
ATM Behaviour
Statemachine
acceptCard()
outOfService()
amount()
<<Redefine>>
FlexibleATM Behaviour
Statemachine
otherAmount()
rejectTransaction()
101
IBM Software Group
ATM
! State machine of ATM to be redefined
VerifyCard
{final}
acceptCard
ReadAmount
OutOfService
outOfService selectAmount
{final} amount
releaseCard
VerifyTransaction ReleaseCard
{final} {final}
102
IBM Software Group
ATM {extended}
FlexibleATM VerifyCard
{final}
acceptCard
ReadAmount {extended}
otherAmount
OutOfService
outOfService selectAmount
{final} amount enterAmount
reject ok
releaseCard
VerifyTransaction ReleaseCard
{final} {final}
103
IBM Software Group
104
IBM Software Group
Use
Use Interaction
Interaction
Case
Case Diagrams
Diagrams
Diagrams
Diagrams
Activity
Activity Class
Class
Diagrams
Diagrams Diagrams
Diagrams
Deployment Composite
Composite
Deployment Structure
Diagrams
Diagrams Structure
Diagrams
Diagrams
Component
Component State
State
Diagrams
Diagrams Machine
Machine
Diagrams
Diagrams
105
IBM Software Group
Component Diagram
106
IBM Software Group
Component Diagram
<<component>>
:Ticket
<<component>> <<component>>
:Reservation :Passenger
IPerson
107
IBM Software Group
108
IBM Software Group
Use
Use Interaction
Interaction
Case
Case Diagrams
Diagrams
Diagrams
Diagrams
Activity
Activity Class
Class
Diagrams
Diagrams Diagrams
Diagrams
Deployment Composite
Composite
Deployment Structure
Diagrams
Diagrams Structure
Diagrams
Diagrams
Component
Component State
State
Diagrams
Diagrams Machine
Machine
Diagrams
Diagrams
109
IBM Software Group
Deployment Diagram
110
IBM Software Group
Artifacts
<<artifact>>
Ticket.jar
<<manifest>>
<<component>>
:Ticket
111
IBM Software Group
Deployment Diagram
AppServer DB Server
<<deploy>>
<<artifact>>
Ticket.jar
112
IBM Software Group
113
IBM Software Group
Agenda
114
IBM Software Group
115
IBM Software Group
Extension Mechanisms
! Stereotypes
! Tag definitions and tagged values
! Constraints
116
IBM Software Group
Stereotypes
<<metaclass>>
Class
<<stereotype>>
Table
117
IBM Software Group
Stereotype Examples
118
IBM Software Group
Deployment Diagram
119
IBM Software Group
120
IBM Software Group
Constraints
121
IBM Software Group
OCL
122
IBM Software Group
Profiles
123
IBM Software Group
EJB Profile
124
IBM Software Group
Specializing UML
! Lightweight extensions
!Extend semantics of existing UML concepts by specialization
!Conform to standard UML (tool compatibility)
!Profiles, stereotypes
! Heavyweight (MOF) extensions
!Add new non-conformant concepts or
!Incompatible change to existing UML semantics/concepts
Heavyweight Lightweight
extension M extension
125
IBM Software Group
126
IBM Software Group
«clock» stereotype
UML::Class * UML::Attribute
Stereotypes
Clock ClockValue
127
IBM Software Group
Profiles: Notation
! E.g., specializing the standard Component concept
«profile» TimingDevices
«metaclass» «stereotype»
Class Clock
Extension
«stereotype» «stereotype»
Timer ToDclock
128
IBM Software Group
Templates
Class(ifier)
template «bind» <T -> Integer, k -> 10> “Bound”
class
IntegerArray
arrayElement : Integer [10]
129
IBM Software Group
Collaboration Templates
! Useful for capturing design patterns
ObserverPattern
oType, sType
Collaboration
template
«bind»
DeviceObserver
130
IBM Software Group
Package Templates
! Based on simple string substitution
CustomerAccountTemplate customer : StringExpression,
CustomerAccountTemplate
kind : StringExpression
131
IBM Software Group
132
IBM Software Group
Session Summary
! Now that you have completed this session, you should be able
to:
!Identify the different UML diagrams
!Describe the purpose of each diagram
!Use the different diagram and model elements
133
IBM Software Group
134
IBM Software Group
135