$GYDQFHG0RGHOLQJ
.DULQ3DOPNYLVW%UDQ6HOLF-RV
:DUPHUDQG1DWKDQ'\NPDQ
80/5HYLVLRQ7DVN)RUFH
1RYHPEHU
2EMHFW0RGHOLQJZLWK20*80/7XWRULDO6HULHV
© 1999-2000 OMG and Contributors: Crossmeta, EDS, IBM, Enea Data, Hewlett-Packard, InLine Software, IntelliCorp, Kabira Technologies,
Klasse Objecten, ObjectTime Ltd., Rational Software, Unisys
$GYDQFHG0RGHOLQJZLWK80/
2YHUYLHZ
T
,QWURGXFWLRQ
T
$GYDQFHG0RGHOLQJ
T
3DUW0RGHO0DQDJHPHQW
T
.DULQ3DOPNYLVW(QHD 'DWD
T
3DUW([WHQVLRQ0HFKDQLVPVDQG3URILOHV
T
%UDQ6HOLF5DWLRQDO6RIWZDUH
T
1DWKDQ'\NPDQ+HZOHWW3DFNDUG
T
3DUW2EMHFW&RQVWUDLQW/DQJXDJH2&/
T
-RV :DUPHU.ODVVH2EMHFWHQ
$GYDQFHG0RGHOLQJZLWK80/
7XWRULDO6HULHV
T
/HFWXUH,QWURGXFWLRQWR80/
6WUXFWXUDO0RGHOLQJDQG8VH&DVHV
T
/HFWXUH%HKDYLRUDO0RGHOLQJZLWK
80/
T
/HFWXUH$GYDQFHG0RGHOLQJZLWK80/
T
/HFWXUH0HWDGDWD,QWHJUDWLRQZLWK
80/02)DQG;0,
$GYDQFHG0RGHOLQJZLWK80/
7XWRULDO)RFXVWKH/DQJXDJH
T
ODQJXDJH V\QWD[VHPDQWLFV
T
V\QWD[ ODQJXDJHHOHPHQWVHJZRUGV
DUHDVVHPEOHGLQWRH[SUHVVLRQVHJ
SKUDVHVFODXVHV
T
VHPDQWLFV WKHPHDQLQJVRIWKHV\QWDFWLF
H[SUHVVLRQV
T
80/1RWDWLRQ*XLGH± GHILQHV80/¶V
JUDSKLFV\QWD[
T
80/6HPDQWLFV± GHILQHV80/¶V
VHPDQWLFV
$GYDQFHG0RGHOLQJZLWK80/
«metamodel»
UML
Foundation
Model
Management
Behavioral
Elements
dependency
package
80/2YHUYLHZ
$GYDQFHG0RGHOLQJZLWK80/
Foundation
Model
Management
Behavioral
Elements
Core
Extension
Mechanisms
Data
Types
80/2YHUYLHZ
$GYDQFHG0RGHOLQJZLWK80/
Behavioral Elements
Model
Management
Foundation
Use Cases
State Machines
Activity Graphs
Collaborations
Common
Behavior
80/2YHUYLHZ
$GYDQFHG0RGHOLQJZLWK80/
$GYDQFHG0RGHOLQJZLWK80/
T
3DUW0RGHO0DQDJHPHQW
T
3DUW([WHQVLRQ0HFKDQLVPVDQG3URILOHV
T
3DUW2EMHFW&RQVWUDLQW/DQJXDJH2&/
$GYDQFHG0RGHOLQJZLWK80/
«metamodel»
UML
Foundation
Model
Management
Behavioral
Elements
80/2YHUYLHZ
$GYDQFHG0RGHOLQJZLWK80/
0RGHO0DQDJHPHQW2YHUYLHZ
T
0DLQ80/FRQVWUXFWVXVHGIRU
PRGHOPDQDJHPHQW
T
3DFNDJH
T
6XEV\VWHP
T
0RGHO
$GYDQFHG0RGHOLQJZLWK80/
8QLI\LQJ&RQFHSWV
T
3DFNDJHV6XEV\VWHPVDQG0RGHOV
T
*URXSRWKHUPRGHOHOHPHQWVWRJHWKHU
T
(DFKJURXSVHOHPHQWVIRUDGLIIHUHQW
UHDVRQSURYLGLQJGLIIHUHQWVHPDQWLFV
T
2WKHUJURXSLQJHOHPHQWVLQ80/
LQFOXGH
T
&ODVVHV
T
&RPSRQHQWV
$GYDQFHG0RGHOLQJZLWK80/
3DFNDJH
T
:KDWDUH3DFNDJHV"
T
&RUH&RQFHSWV
T
'LDJUDP7RXU
T
:KHQWR8VH3DFNDJHV
T
0RGHOLQJ 7LSV
$GYDQFHG0RGHOLQJZLWK80/
3DFNDJH
$SDFNDJHLVDJURXSLQJRIPRGHOHOHPHQWV
$GYDQFHG0RGHOLQJZLWK80/
3DFNDJH± ([DPSOH
Order
Customer
Location
Item
Stock Item
Order Item
Sales
Warehouse
$GYDQFHG0RGHOLQJZLWK80/
3DFNDJH
T
$SDFNDJHFDQFRQWDLQPRGHOHOHPHQWV
RIGLIIHUHQWNLQGV
T
,QFOXGLQJRWKHUSDFNDJHVWRFUHDWH
KLHUDUFKLHV
T
$SDFNDJHGHILQHVDQDPHVSDFHIRULWV
FRQWHQWV
T
3DFNDJHVFDQEHXVHGIRUYDULRXV
SXUSRVHV
$GYDQFHG0RGHOLQJZLWK80/
&RUH&RQFHSWV
Construct
Description
Syntax
Access
Import
A dependency indicating that the
public contents of the target
package are added to the namespace
of the source package.
«import»
A dependency indicating that the
public contents of the target
package are available in the
namespace of the source package.
«access»
Package
A grouping of model elements.
Name
$GYDQFHG0RGHOLQJZLWK80/
9LVLELOLW\
T
(DFKFRQWDLQHGHOHPHQWKDVDYLVLELOLW\
UHODWLYHWRWKHFRQWDLQLQJSDFNDJH
T
$SXEOLF HOHPHQWLVYLVLEOHWRHOHPHQWVRXWVLGHWKH
SDFNDJHGHQRWHGE\µ¶
T
$SURWHFWHG HOHPHQWLVYLVLEOHRQO\WRHOHPHQWV
ZLWKLQLQKHULWLQJSDFNDJHVGHQRWHGE\µ¶
T
$SULYDWH HOHPHQWLVQRWYLVLEOHDWDOOWRHOHPHQWV
RXWVLGHWKHSDFNDJHGHQRWHGE\µ¶
T
6DPHV\QWD[IRUYLVLELOLW\RIDWWULEXWHVDQG
RSHUDWLRQVLQFODVVHV
$GYDQFHG0RGHOLQJZLWK80/
X
Y
,PSRUW
«import»
A
B
+C
-D
+E
A
B
+C
-D
+E
X
Y
Y::C
Y::E
«import»
7KHDVVRFLDWLRQVDUHRZQHGE\SDFNDJH;
$GYDQFHG0RGHOLQJZLWK80/
,PSRUW± $OLDV
$QLPSRUWHGHOHPHQWFDQEHJLYHQDORFDODOLDVDQGD
ORFDOYLVLELOLW\
«import»
A
B
+B
-D
+E
X
Y
A
B
+B
-D
X
Y
+E
«import»
+Y::E
+Y::B
-C
same class
$GYDQFHG0RGHOLQJZLWK80/
A
B
+C
-D
+E
X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WDUH6XEV\VWHPV"
T
&RUH&RQFHSWV
T
'LDJUDP7RXU
T
:KHQWR8VH6XEV\VWHPV
T
0RGHOLQJ 7LSV
$GYDQFHG0RGHOLQJZLWK80/
6XEV\VWHPVDUHXVHGIRU
V\VWHPGHFRPSRVLWLRQ
6XEV\VWHP
$GYDQFHG0RGHOLQJZLWK80/
6XEV\VWHP± ([DPSOH
Trunk
Traffic
Control
Subscription
&RPPXQLFDWLQJVXEV\VWHPV
FRQVWLWXWHDV\VWHP
$GYDQFHG0RGHOLQJZLWK80/
&RUH&RQFHSWV
Subsystem
Construct
Description
Syntax
A grouping of model elements
that represents a behavioral unit
in a physical system.
Name
$GYDQFHG0RGHOLQJZLWK80/
6XEV\VWHP$VSHFWV
T
$VXEV\VWHPKDVWZRDVSHFWV
T
$QH[WHUQDOYLHZVKRZLQJWKHVHUYLFHV
SURYLGHGE\WKHVXEV\VWHP
T
$QLQWHUQDOYLHZVKRZLQJWKH
UHDOL]DWLRQRIWKHVXEV\VWHP
T
7KHUHLVDPDSSLQJEHWZHHQWKHWZR
DVSHFWV
$GYDQFHG0RGHOLQJZLWK80/
6XEV\VWHP$VSHFWV
$VXEV\VWHPKDVDVSHFLILFDWLRQDQGDUHDOL]DWLRQ
Realization elements
Specification elements
$GYDQFHG0RGHOLQJZLWK80/
6XEV\VWHP5HDOL]DWLRQ
T
7KHVXEV\VWHPUHDOL]DWLRQGHILQHVWKHDFWXDOFRQWHQWVRI
WKHVXEV\VWHP
T
7KHVXEV\VWHPUHDOL]DWLRQW\SLFDOO\FRQVLVWVRIFODVVHVDQG
WKHLUUHODWLRQVKLSVRUDFRQWDLQHGKLHUDUFK\RIVXEV\VWHPV
ZLWKFODVVHVDVOHDYHV
Realization elements
Specification elements
?
$GYDQFHG0RGHOLQJZLWK80/
7KHVXEV\VWHPVSHFLILFDWLRQGHILQHVWKH
H[WHUQDOYLHZRIWKHVXEV\VWHP
Realization elements
Specification elements
?
6XEV\VWHP6SHFLILFDWLRQ
$GYDQFHG0RGHOLQJZLWK80/
6XEV\VWHP6SHFLILFDWLRQ
T
7KHVXEV\VWHPVSHFLILFDWLRQ
T
GHVFULEHVWKHVHUYLFHVRIIHUHGE\WKH
VXEV\VWHP
T
GHVFULEHVWKHH[WHUQDOO\H[SHULHQFHG
EHKDYLRU RIWKHVXEV\VWHP
T
GRHVQRWUHYHDOWKHLQWHUQDOVWUXFWXUHRI
WKHVXEV\VWHP
T
GHVFULEHVWKHLQWHUIDFHRIWKHVXEV\VWHP
$GYDQFHG0RGHOLQJZLWK80/
6SHFLILFDWLRQ7HFKQLTXHV
T
7KH8VH&DVHDSSURDFK
T
7KH6WDWH0DFKLQHDSSURDFK
T
7KH/RJLFDO&ODVVDSSURDFK
T
7KH2SHUDWLRQDSSURDFK
«DQGFRPELQDWLRQVRIWKHVH
$GYDQFHG0RGHOLQJZLWK80/
T
)RUVXEV\VWHPVHUYLFHVXVHGLQFHUWDLQVHTXHQFHV
T
:KHQWKHVSHFLILFDWLRQLVWREHXQGHUVWRRGE\QRQ
WHFKQLFDOSHRSOH
Realization elements
Specification elements
8VH&DVH$SSURDFK
$GYDQFHG0RGHOLQJZLWK80/
8VH&DVH$SSURDFK± ([DPSOH
Traffic Control
Specification elements
Realization elements
Change Digit Analysis Information
Initiate Call
Receive Digit and Connect
Hook Signal and Disconnect
Operator
Trunk
Subscription
$GYDQFHG0RGHOLQJZLWK80/
6WDWH0DFKLQH$SSURDFK
T
)RUVXEV\VWHPVZLWKVWDWHGHSHQGHQW
EHKDYLRU
Specification elements
Stopped
Running
Error
Maintenance
Exhausted
Traffic Control
T
)RFXVHVRQWKHVWDWHVRIWKHVXEV\VWHPDQGWKH
WUDQVLWLRQVEHWZHHQWKHP
$GYDQFHG0RGHOLQJZLWK80/
Specification elements
Analyzer
Number
Dictionary
Network
Manager
Traffic Control
/RJLFDO&ODVV$SSURDFK
T
:KHQXVDJHRIWKHVXEV\VWHPLVSHUFHLYHGDV
PDQLSXODWLRQRIREMHFWV
T
:KHQWKHUHTXLUHPHQWVDUHJXLGHGE\DSDUWLFXODU
VWDQGDUG
$GYDQFHG0RGHOLQJZLWK80/
2SHUDWLRQ$SSURDFK
T
)RUVXEV\VWHPVSURYLGLQJVLPSOH³DWRPLF´
VHUYLFHV
Operations
initiateConnection (…)
dialledDigit (…)
throughConnect (…)
bAnswer (…)
bOnHook (…)
aOnHook (…)
Traffic Control
T
:KHQWKHRSHUDWLRQVDUHLQYRNHGLQGHSHQGHQWO\
$GYDQFHG0RGHOLQJZLWK80/
0L[LQJ7HFKQLTXHV
Traffic Control
changeDigitAnalysisInformation (...)
Initiate Call
Receive Digit and Connect
Hook Signal and Disconnect
Subscription
Trunk
Specification elements
Specification elements
Operations
$GYDQFHG0RGHOLQJZLWK80/
T
7KHFRPSOHWHVXEV\VWHPV\PEROKDVWKUHHSUHGHILQHG
FRPSDUWPHQWV
Realization elements
Specification elements
Operations
&RPSOHWH6XEV\VWHP1RWDWLRQ
T
(DFKRIWKHFRPSDUWPHQWVPD\EHRSWLRQDOO\RPLWWHG
IURPWKHGLDJUDP
$GYDQFHG0RGHOLQJZLWK80/
6XEV\VWHP,QWHUIDFHV
Trunk
Traffic
Control
Subscription
Trunk
Traffic
Control
Subscription
$GYDQFHG0RGHOLQJZLWK80/
Operations
operation1( ) : Type1
operation2( ) : Type2
operation3( ) : Type3
operation4( ) : Type4
operation5( ) : Type5
«Interface»
«realize»
operation1( )
operation2( )
operation4( )
«Interface»
«realize»
operation2( )
operation3( )
operation5( )
2SHUDWLRQVDQG,QWHUIDFHV
7KHVXEV\VWHPPXVWVXSSRUWDOORSHUDWLRQVLQWKH
RIIHUHGLQWHUIDFHV
$GYDQFHG0RGHOLQJZLWK80/
Specification elements
«Interface»
«realize»
«Interface»
«realize»
6XEV\VWHP,QWHUIDFHV
$GYDQFHG0RGHOLQJZLWK80/
6SHFLILFDWLRQ± 5HDOL]DWLRQ
T
7KHVSHFLILFDWLRQDQGWKHUHDOL]DWLRQ
PXVWEHFRQVLVWHQW
T
7KHPDSSLQJEHWZHHQWKHVSHFLILFDWLRQ
DQGWKHUHDOL]DWLRQFDQEHH[SUHVVHG
E\
T
UHDOL]DWLRQUHODWLRQVKLSV
T
FROODERUDWLRQV
$GYDQFHG0RGHOLQJZLWK80/
Operations
operation1( ) : Type1
operation2( ) : Type2
operation3( ) : Type3
operation4( ) : Type4
operation5( ) : Type5
Realization Elements
«realize»
operation1( )
5HDOL]H5HODWLRQVKLS
5HDOL]DWLRQLVSDUWLFXODUO\XVHIXOLQVLPSOHPDSSLQJV
$GYDQFHG0RGHOLQJZLWK80/
5HDOL]H± ([DPSOH
Realization elements
Specification elements
changeDigitAnalysisInformation ( )
Initiate Call
Receive Digit and Connect
Hook Signal and Disconnect
Subscription
Traffic Control
Operations
Trunk
changeDigitAnalysisInformation ( )
:
:
«realize»
$GYDQFHG0RGHOLQJZLWK80/
&ROODERUDWLRQ
T
$FROODERUDWLRQGHILQHVWKHUROHVWREHSOD\HG
ZKHQDWDVNLVSHUIRUPHG
T
7KHUROHVDUHSOD\HGE\LQWHUDFWLQJLQVWDQFHV
Sequence Diagram
:Trunk
:Traffic Control
:Subscription
markBusy
dialledDigit
dialledDigit
throughConnect
bAnswer
markBusy
Collaboration Diagram
:Trunk
:Traffic Control
:Subscription
3: dialledDigit
6: bAnswer
5: markBusy
1: markBusy
4: throughConnect
2: dialledDigit
$GYDQFHG0RGHOLQJZLWK80/
&ROODERUDWLRQ± 1RWDWLRQ
$FROODERUDWLRQDQGLWVSDUWLFLSDQWV
Collaboration
Role
Class
role name
role name
role name
role name
$GYDQFHG0RGHOLQJZLWK80/
Specification elements Realization elements
Receive Digit and Connect
Hook Signal and Disconnect
Initiate Call
Coordinator
Analysis
Database
Network
Interface
&ROODERUDWLRQ± ([DPSOH
&ROODERUDWLRQVDUHXVHIXOLQPRUHFRPSOH[VLWXDWLRQV
$GYDQFHG0RGHOLQJZLWK80/
6XEV\VWHP,QWHUDFWLRQ
WUDQVPLW
UHFHLYH
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RGHOLQJZLWK80/
0RGHO± ([DPSOH
Design Model
Use Case Model
$GYDQFHG0RGHOLQJZLWK80/
&RUH&RQFHSWV
Model
Trace
Construct
Description
Syntax
A dependency connecting model
elements that represent the same
concept within different models.
Traces are usually non-directed.
«trace»
An abstraction of a system, as
seen from a specific viewpoint
and at a certain level of
abstraction and detail.
Name
$GYDQFHG0RGHOLQJZLWK80/
7UDFH
Analysis
Design
«trace»
$GYDQFHG0RGHOLQJZLWK80/
0RGHO,QKHULWDQFH
T
$PRGHOZLWKDJHQHUDOL]DWLRQWR
DQRWKHUPRGHOLQKHULWVSXEOLFDQG
SURWHFWHGHOHPHQWVWKDWDUH
T
RZQHGRU
T
LPSRUWHG
E\WKHLQKHULWHGPRGHO
$GYDQFHG0RGHOLQJZLWK80/
'LDJUDP7RXU
T
0RGHOVDVVXFKDUHVHOGRPVKRZQLQ
GLDJUDPV
T
7ZRHTXLYDOHQWZD\VWRVKRZFRQWDLQPHQW
$GYDQFHG0RGHOLQJZLWK80/
0RGHOYV'LDJUDP
8VH&DVH
0RGHO
'LDJUDPVPDNHXSWKH
GRFXPHQWDWLRQRIDPRGHO
'HVLJQ
0RGHO
$GYDQFHG0RGHOLQJZLWK80/
:KHQWR8VH0RGHOV
T
7RJLYHGLIIHUHQWYLHZVRIDV\VWHPWR
GLIIHUHQWVWDNHKROGHUV
T
7RIRFXVRQDFHUWDLQDVSHFWRID
V\VWHPDWDWLPH
T
7RH[SUHVVWKHUHVXOWVRIGLIIHUHQW
VWDJHVLQDVRIWZDUHGHYHORSPHQW
SURFHVV
$GYDQFHG0RGHOLQJZLWK80/
0RGHOLQJ 7LSV± 0RGHO
T
'HILQHWKHSXUSRVHIRUHDFKPRGHO
T
$PRGHOPXVWJLYHDFRPSOHWHSLFWXUH
RIWKHV\VWHPZLWKLQLWVYLHZSRLQWDQG
OHYHORIDEVWUDFWLRQ
T
)RFXVRQWKHSXUSRVHRIWKHPRGHO
RPLWLUUHOHYDQWLQIRUPDWLRQ
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RIFRQFHSWVIRU
HYHU\PRGHO
T
3UHYHQWVPHWDPRGHOH[SORVLRQ8VLQJ80/
WRPRGHOHYHU\WKLQJDQGDQ\WKLQJ
$GYDQFHG0RGHOLQJZLWK80/
+RZ80/([WHQVLELOLW\:RUNV
T
7KHVWDQGDUG80/VHPDQWLFVFDQEH
YLHZHGDVGHILQLQJDVSDFHRISRVVLEOH
LQWHUSUHWDWLRQV
Standard UML semantics
Standard UML semantics
Standard UML semantics
refined semantics
(valid)
refined semantics
refined semantics
(valid)
(valid)
different semantics
(NOT valid)
different semantics
different semantics
(NOT valid)
(NOT valid)
$GYDQFHG0RGHOLQJZLWK80/
0RGHOV
T
$PRGHO LVDGHVFULSWLRQRIVRPHWKLQJ
T
³DSDWWHUQIRUVRPHWKLQJWREHPDGH´ 0HUULDP
:HEVWHU
T
PRGHO
≠
WKLQJWKDWLVPRGHOHG
T
7KH0DSLV1RW7KH7HUULWRU\
blueprint
(model)
building
building
$GYDQFHG0RGHOLQJZLWK80/
0HWD0RGHOV
T
$UH6LPSO\0RGHOVRI0RGHOV
Class
Class
Class
Association
Association
Association
Objects
Objects
Model
Model
Meta
Meta
-
-
Model
Model
(M0)
(M0)
(M1)
(M1)
(M2)
(M2)
<sawdust>
<2 tons>
<sawdust>
<sawdust>
<2 tons>
<2 tons>
<Ben&Jerry’s>
<Ben&Jerry’s>
<Ben&Jerry’s>
<lard>
<5 tons>
<lard>
<lard>
<5 tons>
<5 tons>
CustomerOrder
CustomerOrder
CustomerOrder
item
quantity
item
item
quantity
quantity
Customer
Customer
Customer
id
id
id
$GYDQFHG0RGHOLQJZLWK80/
7KH80/0HWD0RGHO
T
,VD80/0RGHORI80/
GeneralizableElement
GeneralizableElement
GeneralizableElement
isRoot : Boolean
isLeaf : Boolean
isAbstract : Boolean
isRoot
isRoot
: Boolean
: Boolean
isLeaf
isLeaf
: Boolean
: Boolean
isAbstract
isAbstract
: Boolean
: Boolean
Class
Class
Class
isActive : Boolean
isActive
isActive
: Boolean
: Boolean
Classifier
Classifier
Classifier
Feature
Feature
Feature
visibility : {public, private,
protected}
visibility : {public, private,
visibility : {public, private,
protected}
protected}
*
*
not self.isAbstract implies
self.allOperations->forAll(op |
self.allMethods->exists(m |
m.specification includes (op)))
not self.isAbstract implies
self.allOperations->forAll(op |
self.allMethods->exists(m |
m.specification includes (op)))
Well
Well
-
-
formedness
formedness
constraint (OCL)
constraint (OCL)
Meta-Class
Meta
Meta
-
-
Class
Class
$GYDQFHG0RGHOLQJZLWK80/
7KH80/0HWD0RGHO
T
3XWDQRWKHUZD\80/XVHVDSDUWRI
LWVHOIDVD0HWDODQJXDJH
T
2WKHUH[DPSOHV6FKHPH/LVS6PDOOWDON
T
7KLVVPDOOVXEVHWRI80/LVXVHGWR
GHVFULEHDOORI80/
T
7KHVXEVHWFRQWDLQVFODVVHVDVVRFLDWLRQV
RSHUDWLRQVFRQVWUDLQWVJHQHUDOL]DWLRQHWF
T
7KLVFRUHVXEVHWLVUHODWHGWR02)PRUH
RQ02)LQ3DUW
$GYDQFHG0RGHOLQJZLWK80/
7KH7KUHH%DVLF0HFKDQLVPV
T
6WHUHRW\SHV
T
XVHGWRUHILQHPHWDFODVVHVRURWKHUVWHUHRW\SHV
E\GHILQLQJVXSSOHPHQWDOVHPDQWLFV
T
&RQVWUDLQWV
T
SUHGLFDWHVHJ2&/H[SUHVVLRQVWKDWUHGXFH
VHPDQWLFYDULDWLRQ
T
FDQEHDWWDFKHGWRDQ\PHWDFODVVRUVWHUHRW\SH
T
7DJJHG9DOXHV
T
LQGLYLGXDOPRGLILHUVZLWKXVHUGHILQHGVHPDQWLFV
T
FDQEHDWWDFKHGWRDQ\PHWDFODVVRUVWHUHRW\SH
$GYDQFHG0RGHOLQJZLWK80/
([DPSOH$6SHFLDO7\SHRI&ODVV
Class
Class
Class
isActive : Boolean
isActive
isActive
: Boolean
: Boolean
self.feature->select(f |
f.oclIsKindOf(Operation))-> forAll(o |
o.elementOwnership.visibility = #protected)
self.feature->select(f |
f.oclIsKindOf(Operation))-> forAll(o |
o.elementOwnership.visibility = #protected)
«Capsule»
«Capsule»
«Capsule»
{Language = ”C++”}
{Language = ”C++”}
{Language = ”C++”}
Stereotype
constraint
Stereotype
constraint
Required tag
Required tag
Stereotype
Stereotype
$GYDQFHG0RGHOLQJZLWK80/
([WHQVLELOLW\0HWKRG
T
5HILQHPHQWVDUHVSHFLILHGDWWKH0RGHO0
OHYHOEXWDSSO\WRWKH0HWD0RGHOOHYHO0
T
GRHVQRWUHTXLUH³PHWDPRGHOLQJ´&$6(WRROV
T
FDQEHH[FKDQJHGZLWKPRGHOV
«Capsule»
«Capsule»
«Capsule»
(M1)
(M1)
(M2)
(M2)
Class
Class
Class
Association
Association
Association
CustomerOrder
CustomerOrder
CustomerOrder
item
quantity
item
item
quantity
quantity
Customer
Customer
Customer
id
id
id
«capsule»
aCapsuleClass
«capsule»
«capsule»
aCapsuleClass
aCapsuleClass
$GYDQFHG0RGHOLQJZLWK80/
6WHUHRW\SHV
T
8VHGWRGHILQHVSHFLDOL]HGPRGHOHOHPHQWV
EDVHGRQDFRUH80/PRGHOHOHPHQW
T
'HILQHGE\
T
%DVHPHWDFODVVRUVWHUHRW\SH
:KDWHOHPHQWLVVSHFLDOL]HG"
T
&RQVWUDLQWV
:KDWLVVSHFLDODERXWWKLVVWHUHRW\SH"
T
UHTXLUHGWDJV
:KDWYDOXHVGRHVWKLVVWHUHRW\SHQHHGWRNQRZ"
T
LFRQ
+RZVKRXOG,DSSHDULQDPRGHO"
T
$PRGHOHOHPHQWFDQKDYHDWPRVWRQH
VWHUHRW\SH
$GYDQFHG0RGHOLQJZLWK80/
+HXULVWLF&RPELQLQJ6WHUHRW\SHV
T
7KURXJKPXOWLSOHLQKHULWDQFH
«Capsule»
«Capsule»
«Capsule»
{Language = ”C++”}
{Language = ”C++”}
{Language = ”C++”}
«Square»
«Square»
«Square»
«SquareCapsule»
«
«
SquareCapsule
SquareCapsule
»
»
$GYDQFHG0RGHOLQJZLWK80/
6WHUHRW\SH1RWDWLRQ
T
6HYHUDOFKRLFHV
«capsule»
aCapsuleClass
«capsule»
«capsule»
aCapsuleClass
aCapsuleClass
aCapsuleClass
aCapsuleClass
aCapsuleClass
Stereotype
icon
Stereotype
icon
(a) with
(a) with
guillemets
guillemets
(b) with icon
(b) with icon
(c)
(c)
iconified
iconified
form
form
$GYDQFHG0RGHOLQJZLWK80/
:KHQWR6WHUHRW\SH"
T
$EVWUDFWFODVVRUVWHUHRW\SH"
Class
Class
Class
isActive : Boolean
isActive
isActive
: Boolean
: Boolean
«Capsule»
«Capsule»
«Capsule»
<Language = ”C++”>
<Language = ”C++”>
<Language = ”C++”>
AbstractCapsule
Class
AbstractCapsule
AbstractCapsule
Class
Class
«capsule»
aCapsuleClass
«capsule»
«capsule»
aCapsuleClass
aCapsuleClass
T
8VHVWHUHRW\SHVZKHQWKHDGGLWLRQDOVHPDQWLFLQIRUPDWLRQFDQQRW
EHVSHFLILHGXVLQJVWDQGDUGPRGHOLQJPHDQVDYDLODEOHDWWKH0
OHYHO
T
6WHUHRW\SHVDUHEHVWIRUFDSWXULQJVHPDQWLFLQIRUPDWLRQWKDW
ZRXOGDIIHFWKRZWKHPRGHOLVLPSOHPHQWHGRUXVHGE\DWRRORU
GHYHORSHU
©&RUED,'/ª6WHUHRW\SHRI&ODVV,PSOHPHQWHGDVD&25%$
,'/ILOHQRWDVD-DYD&ODVV
$GYDQFHG0RGHOLQJZLWK80/
7DJJHG9DOXHVDQG&RQVWUDLQWV
T
7DJJHGYDOXHV
T
FRQVLVWRIDWDJ DQGYDOXH SDLU
T
RIWHQXVHGWRPRGHOVWHUHRW\SHDWWULEXWHV
$GGLWLRQDOLQIRUPDWLRQWKDWLVXVHIXOUHTXLUHGWR
LPSOHPHQWXVHWKHPRGHO
T
DUELWUDU\GRPDLQVSHFLILFVHPDQWLFV
LQVWUXFWLRQVWRDFRGHJHQHUDWRU³GHEXJBIODJ WUXH´
SURMHFWPDQDJHPHQWGDWD³VWDWXV XQLWBWHVWHG´
HWF
T
&RQVWUDLQWV
T
IRUPDORULQIRUPDOH[SUHVVLRQV
T
PXVWQRWFRQWUDGLFWLQKHULWHGEDVHVHPDQWLFV
$GYDQFHG0RGHOLQJZLWK80/
&RQVWUDLQW1RWDWLRQ
T
(QFORVHGLQEUDFHV³^«`´
T
&DQDSSHDULQYDULRXVSODFHVLQDPRGHO
ATM_Withdrawal
ATM_Withdrawal
ATM_Withdrawal
customer : id
amount : Money
{amount is multiple of $20}
customer : id
customer : id
amount : Money
amount : Money
{amount is multiple of $20}
{amount is multiple of $20}
Account
Account
Account
customer : id
balance : Money
customer : id
customer : id
balance : Money
balance : Money
«constraint»
{ATM_Withdrawal.customer =
Account.customer}
«constraint»
«constraint»
{ATM_Withdrawal.customer =
{ATM_Withdrawal.customer =
Account.customer}
Account.customer}
$GYDQFHG0RGHOLQJZLWK80/
80/3URILOHV
T
$SDFNDJHRIUHODWHGH[WHQVLELOLW\
HOHPHQWVWKDWFDSWXUHGRPDLQVSHFLILF
YDULDWLRQVDQGXVDJHSDWWHUQV
T
$'RPDLQ6SHFLILFVSHFLDOL]DWLRQRI80/
T
3URILOHVFXUUHQWO\EHLQJGHILQHGE\WKH
20*
T
('2&
T
5HDO7LPH
T
&25%$
T
$GYDQFHG0RGHOLQJZLWK80/
$GYDQFHG0RGHOLQJZLWK80/
T
3DUW0RGHO0DQDJHPHQW
T
3DUW([WHQVLRQ0HFKDQLVPVDQG3URILOHV
T
3DUW2EMHFW&RQVWUDLQW/DQJXDJH2&/
$GYDQFHG0RGHOLQJZLWK80/
2YHUYLHZ
T
:KDWDUHFRQVWUDLQWV"
T
&RUH2&/&RQFHSWV
T
$GYDQFHG2&/&RQFHSWV
T
:UDSXS
$GYDQFHG0RGHOLQJZLWK80/
:K\XVH2&/"
What’s in it
for me?
Use the
Object
Constraint
Language
&DQZHPDNHWKLVPRUHSUHFLVH"
Flight
Airplane
CargoFlight
PassengerFlight
PasssengerPlane
CargoPlane
1
1
0..*
0..*
1
1
0..*
0..*
0..*
0..*
1
1
flights
'LDJUDPZLWKDGGHGLQYDULDQWV
{context Flight
inv: type = #cargo implies airplane.type = #cargo
inv: type = #passenger implies airplane.type = #passenger}
1
0..*
Flight
Airplane
type :
enum of cargo, passenger
type :
enum of cargo, passenger
flights
$GYDQFHG0RGHOLQJZLWK80/
'HILQLWLRQRIFRQVWUDLQW
T
³$FRQVWUDLQWLVDUHVWULFWLRQRQRQHRU
PRUHYDOXHVRISDUWRIDQREMHFW
RULHQWHGPRGHORUV\VWHP´
$GYDQFHG0RGHOLQJZLWK80/
'LIIHUHQWNLQGVRIFRQVWUDLQWV
T
&ODVVLQYDULDQW
T
DFRQVWUDLQWWKDWPXVWDOZD\VEHPHWE\DOO
LQVWDQFHVRIWKHFODVV
T
3UHFRQGLWLRQRIDQRSHUDWLRQ
T
DFRQVWUDLQWWKDWPXVWDOZD\VEHWUXH
%()25(WKHH[HFXWLRQRIWKHRSHUDWLRQ
T
3RVWFRQGLWLRQ RIDQRSHUDWLRQ
T
DFRQVWUDLQWWKDWPXVWDOZD\VEHWUXH
$)7(5WKHH[HFXWLRQRIWKHRSHUDWLRQ
$GYDQFHG0RGHOLQJZLWK80/
&RQVWUDLQWVWHUHRW\SHV
T
80/GHILQHVWKUHHVWDQGDUGVWHUHRW\SHV
IRUFRQVWUDLQWV
T
LQYDULDQW
T
SUHFRQGLWLRQ
T
SRVWFRQGLWLRQ
$GYDQFHG0RGHOLQJZLWK80/
:KDWLV2&/"
T
2&/LV
T
DWH[WXDOODQJXDJHWRGHVFULEHFRQVWUDLQWV
T
WKHFRQVWUDLQWODQJXDJHXVHGLQ80/
PRGHOV
T
$VZHOODVWKH80/PHWDPRGHO
T
)RUPDOEXWHDV\WRXVH
T
XQDPELJXRXV
T
QRVLGHHIIHFWV
$GYDQFHG0RGHOLQJZLWK80/
&RQVWUDLQWVDQGWKH80/PRGHO
T
2&/H[SUHVVLRQVDUHDOZD\VERXQGWRD
80/PRGHO
T
2&/H[SUHVVLRQVFDQEHERXQGWRDQ\
PRGHOHOHPHQWLQ80/
$GYDQFHG0RGHOLQJZLWK80/
2YHUYLHZ
T
:KDWDUHFRQVWUDLQWV
T
&RUH2&/&RQFHSWV
T
$GYDQFHG2&/&RQFHSWV
T
:UDSXS
$GYDQFHG0RGHOLQJZLWK80/
([DPSOHPRGHO
Airport
Flight
Passenger
Airline
*
*
*
*
$minAge: Integer
age: Integer
needsAssistance: Boolean
departTime: Time
/arrivalTime: Time
duration : Interval
maxNrPassengers: Integer
origin
desti-
nation
name: String
name: String
{ordered}
arriving
Flights
departing
Flights
CEO
0..1
flights
passengers
book(f : Flight)
0..1
airline
airline
$GYDQFHG0RGHOLQJZLWK80/
&RQVWUDLQWFRQWH[WDQGVHOI
T
(YHU\2&/H[SUHVVLRQLVERXQGWRD
VSHFLILFFRQWH[W
T
7KHFRQWH[WLVRIWHQWKHHOHPHQWWKDWWKH
FRQVWUDLQWLVDWWDFKHGWR
T
7KHFRQWH[WPD\EHGHQRWHGZLWKLQWKH
H[SUHVVLRQXVLQJWKHNH\ZRUGµVHOI¶
T
µVHOI¶LVLPSOLFLWLQDOO2&/H[SUHVVLRQV
T
6LPLODUWRCWKLV¶LQ&
$GYDQFHG0RGHOLQJZLWK80/
1RWDWLRQ
T
&RQVWUDLQWVPD\EHGHQRWHGZLWKLQWKH
80/PRGHORULQDVHSDUDWHGRFXPHQW
T
WKHH[SUHVVLRQ
FRQWH[W)OLJKWLQYVHOIGXUDWLRQ
T
LVLGHQWLFDOWR
FRQWH[W)OLJKWLQYGXUDWLRQ
T
LVLGHQWLFDOWR
Flight
duration: Integer
<<invariant>>
duration < 4
$GYDQFHG0RGHOLQJZLWK80/
(OHPHQWVRIDQ2&/H[SUHVVLRQ
T
,QDQ2&/H[SUHVVLRQWKHVHHOHPHQWV
PD\EHXVHG
T
EDVLFW\SHV6WULQJ%RROHDQ,QWHJHU5HDO
T
FODVVLILHUVIURPWKH80/PRGHODQGWKHLU
IHDWXUHV
T
DWWULEXWHVDQGFODVVDWWULEXWHV
T
TXHU\RSHUDWLRQVDQGFODVVTXHU\RSHUDWLRQV
T
DVVRFLDWLRQVIURPWKH80/PRGHO
$GYDQFHG0RGHOLQJZLWK80/
([DPSOH2&/EDVLFW\SHV
context Airline inv:
name.toLower = ‘klm’
context Passenger inv:
age >= ((9.6 - 3.5)* 3.1).floor implies
mature = true
$GYDQFHG0RGHOLQJZLWK80/
0RGHOFODVVHVDQGDWWULEXWHV
T
³1RUPDO´DWWULEXWHV
context Flight inv:
self.maxNrPassengers <= 1000
T
&ODVVDWWULEXWHV
context Passenger inv:
age >= Passenger.mi
Q$JH
$GYDQFHG0RGHOLQJZLWK80/
([DPSOHTXHU\RSHUDWLRQV
context Flight inv:
self.departTime.difference(self.arrivalTime)
.equals(self.duration)
Time
difference(t:Time):Interval
before(t: Time): Boolean
plus(d : Interval) : Time
Interval
equals(i:Interval):Boolean
$Interval(d, h, m : Integer) :
Interval
$midnight: Time
month : String
day : Integer
year : Integer
hour : Integer
minute : Integer
nrOfDays : Integer
nrOfHours : Integer
nrOfMinutes : Integer
$GYDQFHG0RGHOLQJZLWK80/
$VVRFLDWLRQVDQGQDYLJDWLRQV
T
(YHU\DVVRFLDWLRQLQWKHPRGHOLV
DQDYLJDWLRQSDWK
T
7KHFRQWH[WRIWKHH[SUHVVLRQLV
WKHVWDUWLQJSRLQW
T
5ROHQDPHVDUHXVHGWRLGHQWLI\
WKHQDYLJDWHGDVVRFLDWLRQ
$GYDQFHG0RGHOLQJZLWK80/
([DPSOHQDYLJDWLRQV
T
1DYLJDWLRQV
context Flight
inv: origin <> destination
inv: origin.name = ‘Amsterdam’
context Flight
inv: airline.name = ‘KLM’
$GYDQFHG0RGHOLQJZLWK80/
$VVRFLDWLRQFODVVHV
context Person inv:
if employer.name = ‘Klasse Objecten’ then
job.type = #trainer
else
job.type = #programmer
endif
Person
Company
Job
*
1
employee
employer
type : {trainer, programmer}
name : String
$GYDQFHG0RGHOLQJZLWK80/
7KH2&/&ROOHFWLRQW\SHV
T
:KDWDUHFRQVWUDLQWV
T
&RUH2&/&RQFHSWV
T
&ROOHFWLRQV
T
$GYDQFHG2&/&RQFHSWV
T
:UDSXS
$GYDQFHG0RGHOLQJZLWK80/
7KUHH6XEW\SHVRI&ROOHFWLRQ
T
6HW
T
DUULYLQJ)OLJKWVIURPWKHFRQWH[W$LUSRUW
T
1RQRUGHUHGXQLTXH
T
%DJ
T
DUULYLQJ)OLJKWVGXUDWLRQIURPWKHFRQWH[W
$LUSRUW
T
1RQRUGHUHGQRQXQLTXH
T
6HTXHQFH
T
SDVVHQJHUVIURPWKHFRQWH[W)OLJKW
T
2UGHUHGQRQXQLTXH
$GYDQFHG0RGHOLQJZLWK80/
&ROOHFWLRQRSHUDWLRQV
T
2&/KDVDJUHDWQXPEHURISUHGHILQHG
RSHUDWLRQVRQWKHFROOHFWLRQVW\SHV
T
6\QWD[
:
T
collection
->
operation
$GYDQFHG0RGHOLQJZLWK80/
7KHFROOHFWRSHUDWLRQ
T
6\QWD[
collection->collect(elem : T | expr)
collection->collect(elem | expr)
collection->collect(expr)
T
6KRUWKDQG
collection.expr
T
7KHFROOHFWRSHUDWLRQUHVXOWVLQWKHFROOHFWLRQ
RIWKHYDOXHVUHVXOWLQJHYDOXDWLQJ H[SU IRUDOO
HOHPHQWVLQWKHFROOHFWLRQ
T
6KRUWKDQGRIWHQWULSVSHRSOHXS%H&DUHIXO
$GYDQFHG0RGHOLQJZLWK80/
([DPSOHFROOHFWRSHUDWLRQ
FRQWH[W$LUSRUWLQY
VHOIDUULYLQJ)OLJKWV!FROOHFWDLU/LQH!QRW(PSW\
airp1
airp2
f1
f2
f3
f4
f5
airline1
airline2
airline3
departing flights
arriving flights
$GYDQFHG0RGHOLQJZLWK80/
7KHVHOHFWRSHUDWLRQ
T
6\QWD[
collection->select(elem : T | expression)
collection->select(elem | expression)
collection->select(expression)
T
7KHVHOHFWRSHUDWLRQUHVXOWVLQWKH
VXEVHWRIDOOHOHPHQWVIRUZKLFK
H[SUHVVLRQ LVWUXH
$GYDQFHG0RGHOLQJZLWK80/
([DPSOHFROOHFWRSHUDWLRQ
FRQWH[W$LUSRUWLQY
VHOIGHSDUWLQJ)OLJKWV!VHOHFWGXUDWLRQ!QRW(PSW\
departing flights
arriving flights
airp1
airp2
airline1
airline2
airline3
f5
duration = 2
f1
duration = 2
f4
duration = 5
f2
duration = 5
f3
duration = 3
$GYDQFHG0RGHOLQJZLWK80/
7KHIRU$OO RSHUDWLRQ
T
6\QWD[
T
FROOHFWLRQ!IRU$OOHOHP 7_H[SU
T
FROOHFWLRQ!IRU$OOHOHP _H[SU
T
FROOHFWLRQ!IRU$OOH[SU
T
7KHIRU$OO RSHUDWLRQUHVXOWVLQWUXHLI
H[SU LVWUXHIRUDOOHOHPHQWVRIWKH
FROOHFWLRQ
$GYDQFHG0RGHOLQJZLWK80/
([DPSOH IRU$OO RSHUDWLRQ
FRQWH[W$LUSRUWLQY
VHOIGHSDUWLQJ)OLJKWV!IRU$OOGHSDUW7LPHKRXU!
departing flights
arriving flights
airp1
airp2
airline1
airline2
airline3
f5
depart = 8
f1
depart = 7
f4
depart = 9
f2
depart = 5
f3
depart = 8
$GYDQFHG0RGHOLQJZLWK80/
7KHH[LVWVRSHUDWLRQ
T
6\QWD[
collection->exists(elem : T | expr)
collection->exists(elem | expr)
collection->exists(expr)
T
7KHH[LVWVRSHUDWLRQUHVXOWVLQ
WUXHLIWKHUHLVDWOHDVWRQH
HOHPHQWLQWKHFROOHFWLRQIRU
ZKLFKWKHH[SUHVVLRQH[SU LV
WUXH
$GYDQFHG0RGHOLQJZLWK80/
([DPSOHH[LVWVRSHUDWLRQ
FRQWH[W$LUSRUWLQY
VHOIGHSDUWLQJ)OLJKWV!H[LVWVGHSDUW7LPHKRXU
departing flights
arriving flights
airp1
airp2
airline1
airline2
airline3
f5
depart = 8
f1
depart = 7
f4
depart = 9
f2
depart = 5
f3
depart = 8
$GYDQFHG0RGHOLQJZLWK80/
([DPSOHH[LVWVRSHUDWLRQ
FRQWH[W$LUSRUWLQY
VHOIGHSDUWLQJ)OLJKWV !
H[LVWVGHSDUW7LPHKRXU
$GYDQFHG0RGHOLQJZLWK80/
2WKHUFROOHFWLRQRSHUDWLRQV
T
LV(PSW\WUXHLIFROOHFWLRQKDVQRHOHPHQWV
T
QRW(PSW\WUXHLIFROOHFWLRQKDVDWOHDVWRQH
HOHPHQW
T
VL]HQXPEHURIHOHPHQWVLQFROOHFWLRQ
T
FRXQWHOHPQXPEHURIRFFXUHQFHV RIHOHP
LQFROOHFWLRQ
T
LQFOXGHVHOHPWUXHLIHOHP LVLQFROOHFWLRQ
T
H[FOXGHVHOHPWUXHLIHOHP LVQRWLQ
FROOHFWLRQ
T
LQFOXGHV$OOFROOWUXHLIDOOHOHPHQWVRIFROO
DUHLQFROOHFWLRQ
$GYDQFHG0RGHOLQJZLWK80/
5HVXOWLQSRVWFRQGLWLRQ
T
([DPSOHSUHDQGSRVWFRQGLWLRQ
context Airline::servedAirports() : Set(Airport)
pre : -- none
post: result = flights.destination->asSet
$GYDQFHG0RGHOLQJZLWK80/
6WDWHFKDUWUHIHUULQJWRVWDWHV
T
7KHRSHUDWLRQRFO,Q6WDWH UHWXUQVWUXHLI
WKHREMHFWLVLQWKHVSHFLILHGVWDWH
open
closed
context Bottle inv:
self.oclInState(closed) implies filled = #full
Bottle
filled : enum {empty, half, full}
$GYDQFHG0RGHOLQJZLWK80/
/RFDOYDULDEOHV
T
7KH/HWFRQVWUXFWGHILQHVYDULDEOHVORFDO
WRRQHFRQVWUDLQW
Let var : Type = <expression1> in
<expression2>
$GYDQFHG0RGHOLQJZLWK80/
,WHUDWH
T
7KHLWHUDWHRSHUDWLRQIRUFROOHFWLRQVLV
WKHPRVWJHQHULFDQGFRPSOH[EXLOGLQJ
EORFN
FROOHFWLRQ!LWHUDWHHOHP 7\SH
DQVZHU7\SH YDOXH!_
H[SUHVVLRQZLWKHOHPDQGDQVZHU!
$GYDQFHG0RGHOLQJZLWK80/
,WHUDWHH[DPSOH
T
([DPSOHLWHUDWH
context Airline inv:
flights->select(maxNrPassengers > 150)-
>notEmpty
T
,VLGHQWLFDOWR
context Airline inv:
flights->iterate(f : Flight; answer : Set(Flight) =
Set{ } |
if f.maxNrPassengers > 150 then
answer->including(f)
else answer endif )->notEmpty
$GYDQFHG0RGHOLQJZLWK80/
,QKHULWDQFHRIFRQVWUDLQWV
T
*XLGLQJSULQFLSOH/LVNRY¶V 6XEVWLWXWLRQ
3ULQFLSOH/63
T
³:KHQHYHUDQLQVWDQFHRIDFODVVLV
H[SHFWHGRQHFDQDOZD\VVXEVWLWXWHDQ
LQVWDQFHRIDQ\RILWVVXEFODVVHV´
$GYDQFHG0RGHOLQJZLWK80/
,QKHULWDQFHRIFRQVWUDLQWV
T
&RQVHTXHQFHVRI/63IRULQYDULDQWV
T
$QLQYDULDQWLVDOZD\VLQKHULWHGE\HDFK
VXEFODVV
T
6XEFODVVHVPD\VWUHQJWKHQWKHLQYDULDQW
T
&RQVHTXHQFHVRI/63IRUSUHFRQGLWLRQV
DQGSRVWFRQGLWLRQV
T
$SUHFRQGLWLRQPD\EHZHDNHQHG
T
$SRVWFRQGLWLRQ PD\EHVWUHQJWKHQHG
$GYDQFHG0RGHOLQJZLWK80/
T
:KDWDUHFRQVWUDLQWV
T
&RUH2&/&RQFHSWV
T
$GYDQFHG2&/&RQFHSWV
T
:UDSXS
:UDS8S
$GYDQFHG0RGHOLQJZLWK80/
&XUUHQW'HYHORSPHQWV
T
)HHGEDFNIURPVHYHUDO2&/
LPSOHPHQWHUVKDQGOHGLQ80/57)
T
HJWKHJUDPPDUKDVVRPHORRVHHQGV
T
W\SLFDOWRROUHODWHGLVVXHV
T
'HYHORSPHQWRI2&/PHWDPRGHO
T
FXUUHQWO\FRQFUHWHV\QWD[RQO\
T
ZLOOUHVXOWLQDEVWUDFWV\QWD[
T
2&/:RUNVKRSZLWK S80/ JURXS
T
IRUPDOL]DWLRQR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