Top Banner
IBM Software Group ® Cl ic An Introduction to UML 2.0 Bran Selic IBM Distinguished Engineer IBM Rational Software – Canada [email protected]
21

IBM Software Group ® Clic k to edit Ma ster sub title styl e An Introduction to UML 2.0 Bran Selic IBM Distinguished Engineer IBM Rational Software – Canada.

Dec 26, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: IBM Software Group ® Clic k to edit Ma ster sub title styl e An Introduction to UML 2.0 Bran Selic IBM Distinguished Engineer IBM Rational Software – Canada.

IBM Software Group

®

Click to edit Master subtitle style

An Introduction to UML 2.0An Introduction to UML 2.0

Bran SelicIBM Distinguished Engineer

IBM Rational Software – [email protected]

Bran SelicIBM Distinguished Engineer

IBM Rational Software – [email protected]

Page 2: IBM Software Group ® Clic k to edit Ma ster sub title styl e An Introduction to UML 2.0 Bran Selic IBM Distinguished Engineer IBM Rational Software – Canada.

33 IBM Software Group |

1967

Foundations of OO (Nygaard, Goldberg, Meyer,Foundations of OO (Nygaard, Goldberg, Meyer,Stroustrup, Harel, Wirfs-Brock, Reenskaug,…)Stroustrup, Harel, Wirfs-Brock, Reenskaug,…)

Foundations of OO (Nygaard, Goldberg, Meyer,Foundations of OO (Nygaard, Goldberg, Meyer,Stroustrup, Harel, Wirfs-Brock, Reenskaug,…)Stroustrup, Harel, Wirfs-Brock, Reenskaug,…)

UML: The Foundation of MDAUML: The Foundation of MDA

1996

UML 1.1 (OMG Standard)UML 1.1 (OMG Standard)UML 1.1 (OMG Standard)UML 1.1 (OMG Standard)

UML 1.3 (extensibility)UML 1.3 (extensibility)UML 1.3 (extensibility)UML 1.3 (extensibility)

UML 1.4 (action semantics)UML 1.4 (action semantics)UML 1.4 (action semantics)UML 1.4 (action semantics)

UML 1.5UML 1.5UML 1.5UML 1.5

1997

1998

20011Q2003

3Q2004

UML 2.0 (MDA)UML 2.0 (MDA)UML 2.0 (MDA)UML 2.0 (MDA)

JacobsonJacobsonHarelHarelBoochBoochRumbaughRumbaugh

Page 3: IBM Software Group ® Clic k to edit Ma ster sub title styl e An Introduction to UML 2.0 Bran Selic IBM Distinguished Engineer IBM Rational Software – Canada.

44 IBM Software Group |

Formal RFP RequirementsFormal RFP Requirements

1) Infrastructure – UML internals More precise conceptual base for better MDA support

2) Superstructure – User-level features New capabilities for large-scale software systems Consolidation of existing features

3) OCL – Constraint language Full conceptual alignment with UML

4) Diagram interchange standard For exchanging graphic information (model diagrams)

1) Infrastructure – UML internals More precise conceptual base for better MDA support

2) Superstructure – User-level features New capabilities for large-scale software systems Consolidation of existing features

3) OCL – Constraint language Full conceptual alignment with UML

4) Diagram interchange standard For exchanging graphic information (model diagrams)

Page 4: IBM Software Group ® Clic k to edit Ma ster sub title styl e An Introduction to UML 2.0 Bran Selic IBM Distinguished Engineer IBM Rational Software – Canada.

55 IBM Software Group |

Language StructureLanguage Structure A core language + a set of optional “sub-languages”

Defined in three separate compliance levels

A core language + a set of optional “sub-languages” Defined in three separate compliance levels

OCLOCL

Basic UMLBasic UML(Classes, Basic behavior, Internal structure, Use cases…)(Classes, Basic behavior, Internal structure, Use cases…)

MOFMOF ProfilesProfiles

StateStateMachinesMachines

StructuredStructuredClasses andClasses andComponentsComponents

ActivitiesActivities InteractionsInteractions DetailedDetailedActionsActions

FlowsFlows

Basic LevelBasic Level

Intermediate LevelIntermediate Level

Complete LevelComplete Level

UML InfrastructureUML Infrastructure

Multiple levels of Multiple levels of compliancecompliance

Multiple levels of Multiple levels of compliancecompliance

Page 5: IBM Software Group ® Clic k to edit Ma ster sub title styl e An Introduction to UML 2.0 Bran Selic IBM Distinguished Engineer IBM Rational Software – Canada.

77 IBM Software Group |

«import»«import»

ClassifiersClassifiersClassifiersClassifiers

NamespaceNamespaceNamespaceNamespace

ElementElementElementElement

NamedElementNamedElementNamedElementNamedElement

name : Stringname : Stringname : Stringname : String

NamespaceNamespaceNamespaceNamespace

Infrastructure Example: Classifier DefinitionInfrastructure Example: Classifier Definition Constructed from a

basic set of primitive concepts

Constructed from a basic set of primitive concepts

«import»«import»

OwnershipOwnershipOwnershipOwnership

ElementElementElementElement

ClassifierClassifierClassifierClassifier

NamespaceNamespaceNamespaceNamespace

NamedElementNamedElementNamedElementNamedElement

FeatureFeatureFeatureFeature

Page 6: IBM Software Group ® Clic k to edit Ma ster sub title styl e An Introduction to UML 2.0 Bran Selic IBM Distinguished Engineer IBM Rational Software – Canada.

88 IBM Software Group |

UML 2.0: Run-Time SemanticsUML 2.0: Run-Time Semantics

Basic Structural ConceptsBasic Structural Concepts

BehaviorFoundationBehaviorFoundation InteractionsInteractions(Communications)(Communications)

. . .. . .ActivitiesActivities StateStateMachinesMachinesActionsActions

Page 7: IBM Software Group ® Clic k to edit Ma ster sub title styl e An Introduction to UML 2.0 Bran Selic IBM Distinguished Engineer IBM Rational Software – Canada.

99 IBM Software Group |

ActivityMActivityM

.

.

.

.

.

.

Behavioral FoundationsBehavioral Foundations Data/control flow foundations for maximal implementation

flexibility Data/control flow foundations for maximal implementation

flexibility

.

.

.

.

.

.Action1Action1

VariableAVariableAVariableAVariableA

.

.

.

.

.

.Action3Action3

.

.

.

.

.

.Action2Action2

Input PinInput Pin(typed)(typed)

OutputPinOutputPin(typed)(typed)

Control FlowControl Flow

Data FlowData Flow

Page 8: IBM Software Group ® Clic k to edit Ma ster sub title styl e An Introduction to UML 2.0 Bran Selic IBM Distinguished Engineer IBM Rational Software – Canada.

1010 IBM Software Group |

Categories of ActionsCategories of Actions Communication actions (send, call, receive,…) Primitive function action Object actions (create, destroy, reclassify,start,…) Structural feature actions (read, write, clear,…) Link actions (create, destroy, read, write,…) Variable actions (read, write, clear,…) Exception action (raise)

Communication actions (send, call, receive,…) Primitive function action Object actions (create, destroy, reclassify,start,…) Structural feature actions (read, write, clear,…) Link actions (create, destroy, read, write,…) Variable actions (read, write, clear,…) Exception action (raise)

Page 9: IBM Software Group ® Clic k to edit Ma ster sub title styl e An Introduction to UML 2.0 Bran Selic IBM Distinguished Engineer IBM Rational Software – Canada.

1111 IBM Software Group |

ActivitiesActivities Significantly enriched in UML 2.0 (relative to UML 1.x

activities) More flexible semantics for greater modeling power (e.g., rich

concurrency model based on Petri Nets) Many new features

Major influences for UML 2.0 activity semantics Business Process Execution Language for Web Services

(BPEL4WS) – a de facto standard supported by key industry players (Microsoft, IBM, etc.)

Functional modeling from the systems engineering community (INCOSE)

Significantly enriched in UML 2.0 (relative to UML 1.x activities) More flexible semantics for greater modeling power (e.g., rich

concurrency model based on Petri Nets) Many new features

Major influences for UML 2.0 activity semantics Business Process Execution Language for Web Services

(BPEL4WS) – a de facto standard supported by key industry players (Microsoft, IBM, etc.)

Functional modeling from the systems engineering community (INCOSE)

Page 10: IBM Software Group ® Clic k to edit Ma ster sub title styl e An Introduction to UML 2.0 Bran Selic IBM Distinguished Engineer IBM Rational Software – Canada.

1212 IBM Software Group |

OrderOrder

Order ProcessingOrder ProcessingInvoice : InvoiceKindInvoice : InvoiceKind

Activity Graph ExampleActivity Graph Example

Receiveorder

Fillorder

Shiporder

Sendinvoice

Makepayment

InvoiceInvoiceAccept

payment

Closeorder

InterruptibleRegion

Inputpin

«precondition» Order entered«precondition» Order entered«postcondition» Order complete«postcondition» Order complete

contractsparameter

Cancelorder

Ordercancelrequest

Page 11: IBM Software Group ® Clic k to edit Ma ster sub title styl e An Introduction to UML 2.0 Bran Selic IBM Distinguished Engineer IBM Rational Software – Canada.

1414 IBM Software Group |

sdsd ATM-transaction ATM-transaction

client: atm: dbase:

Interaction DiagramsInteraction Diagrams

insertCard

CheckPinref

alt [chk= OK]

[else]error(badPIN)

DoTransactionref

sdsd CheckPin CheckPin

client: atm: dbase:

askForPIN

data(PIN)check(PIN)

result(chk)result(chk)

Interaction Frame Lifeline is one object or a partLifeline is one object or a part

Interaction OccurrenceInteraction Occurrence

Combined (in-line) Fragment

Combined (in-line) Fragment

Page 12: IBM Software Group ® Clic k to edit Ma ster sub title styl e An Introduction to UML 2.0 Bran Selic IBM Distinguished Engineer IBM Rational Software – Canada.

1515 IBM Software Group |

Combined Fragment Types (1 of 2)Combined Fragment Types (1 of 2) 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

Break (break) Represents an alternative that is executed instead of the remainder of

the fragment (like a break in a loop) Parallel (par)

Concurrent (interleaved) sub-scenarios Negative (neg)

Identifies sequences that must not occur

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

Break (break) Represents an alternative that is executed instead of the remainder of

the fragment (like a break in a loop) Parallel (par)

Concurrent (interleaved) sub-scenarios Negative (neg)

Identifies sequences that must not occur

Page 13: IBM Software Group ® Clic k to edit Ma ster sub title styl e An Introduction to UML 2.0 Bran Selic IBM Distinguished Engineer IBM Rational Software – Canada.

1616 IBM Software Group |

Combined Fragment Types (2 of 2)Combined Fragment Types (2 of 2) Critical Region (region)

Traces cannot be interleaved with events on any of the participating lifelines

Assertion (assert) Only valid continuation

Loop (loop) Optional guard: [<min>, <max>, <Boolean-expression>] No guard means no specified limit

Critical Region (region) Traces cannot be interleaved with events on any of the

participating lifelines Assertion (assert)

Only valid continuation Loop (loop)

Optional guard: [<min>, <max>, <Boolean-expression>] No guard means no specified limit

Page 14: IBM Software Group ® Clic k to edit Ma ster sub title styl e An Introduction to UML 2.0 Bran Selic IBM Distinguished Engineer IBM Rational Software – Canada.

1818 IBM Software Group |

Structured ClassesStructured Classes Classes with

Internal (collaboration) structure Ports (optional)

Primarily intended for architectural modeling Heritage: architectural description languages (ADLs)

UML-RT profile: Selic and Rumbaugh (1998) ACME: Garlan et al. SDL (ITU-T standard Z.100)

Classes with Internal (collaboration) structure Ports (optional)

Primarily intended for architectural modeling Heritage: architectural description languages (ADLs)

UML-RT profile: Selic and Rumbaugh (1998) ACME: Garlan et al. SDL (ITU-T standard Z.100)

Page 15: IBM Software Group ® Clic k to edit Ma ster sub title styl e An Introduction to UML 2.0 Bran Selic IBM Distinguished Engineer IBM Rational Software – Canada.

1919 IBM Software Group |

Structured Objects: PortsStructured Objects: Ports Multiple points of interaction

Each dedicated to a particular purpose

Multiple points of interaction Each dedicated to a particular purpose

e.g., Database Admin porte.g., Database Admin porte.g., Database Admin porte.g., Database Admin port

e.g., Database Objecte.g., Database Objecte.g., Database Objecte.g., Database Object

e.g., Database User portse.g., Database User portse.g., Database User portse.g., Database User ports

Page 16: IBM Software Group ® Clic k to edit Ma ster sub title styl e An Introduction to UML 2.0 Bran Selic IBM Distinguished Engineer IBM Rational Software – Canada.

2020 IBM Software Group |

Port SemanticsPort Semantics A port can support multiple interface specifications

Provided interfaces (what the object can do) Required interfaces (what the object needs to do its job)

A port can support multiple interface specifications Provided interfaces (what the object can do) Required interfaces (what the object needs to do its job)

«interface»«interface»MasterIFMasterIF

«interface»«interface»MasterIFMasterIF

stateChange ( s : state ) : voidstateChange ( s : state ) : void… … stateChange ( s : state ) : voidstateChange ( s : state ) : void… …

«provides»«provides»

Incoming signals/calls Incoming signals/calls Incoming signals/calls Incoming signals/calls

«interface»«interface»SlaveIFSlaveIF

«interface»«interface»SlaveIFSlaveIF

start ( ) : voidstart ( ) : voidstop ( ) : voidstop ( ) : voidqueryState ( ) : statequeryState ( ) : state… …

start ( ) : voidstart ( ) : voidstop ( ) : voidstop ( ) : voidqueryState ( ) : statequeryState ( ) : state… …

«uses»«uses» p1p1

c:ClassXc:ClassXc:ClassXc:ClassX

Outgoing signals/calls Outgoing signals/calls Outgoing signals/calls Outgoing signals/calls

Page 17: IBM Software Group ® Clic k to edit Ma ster sub title styl e An Introduction to UML 2.0 Bran Selic IBM Distinguished Engineer IBM Rational Software – Canada.

2121 IBM Software Group |

sender : Faxsender : Faxsender : Faxsender : Faxremoteremoteremoteremote

receiver : Faxreceiver : Faxreceiver : Faxreceiver : Fax

remoteremoteremoteremote

Assembling Structured ObjectsAssembling Structured Objects

These connections can be constrained to a protocol These connections can be constrained to a protocol

:FaxProtocol

FaxSender FaxReceiver

Ports can be joined by connectors Ports can be joined by connectors

Static checks for dynamic type violations are possible Eliminates “integration” (architectural) errors

Static checks for dynamic type violations are possible Eliminates “integration” (architectural) errors

Page 18: IBM Software Group ® Clic k to edit Ma ster sub title styl e An Introduction to UML 2.0 Bran Selic IBM Distinguished Engineer IBM Rational Software – Canada.

2222 IBM Software Group |

FaxCallFaxCall

receiveCtrlreceiveCtrlsendCtrlsendCtrl

sender:Faxsender:Fax

remoteremote

receiver:Faxreceiver:Faxremoteremote

cc cc

Structured Classes: Internal StructureStructured Classes: Internal Structure Structured classes may have an internal structure of

(structured class) parts and connectors Structured classes may have an internal structure of

(structured class) parts and connectors

Delegation connectorDelegation connectorDelegation connectorDelegation connector

PartPartPartPart

Page 19: IBM Software Group ® Clic k to edit Ma ster sub title styl e An Introduction to UML 2.0 Bran Selic IBM Distinguished Engineer IBM Rational Software – Canada.

2323 IBM Software Group |

ProductArchitectureProductArchitecture

sender:Faxsender:Faxsender:Faxsender:Fax receiver:Faxreceiver:Fax receiver:Faxreceiver:Fax

Structure Refinement Through InheritanceStructure Refinement Through Inheritance Using standard inheritance mechanism (design by

difference) Using standard inheritance mechanism (design by

difference)

ProductBProductB

sender:Faxsender:Faxsender:Faxsender:Fax receiver:Faxreceiver:Fax receiver:Faxreceiver:Fax

ProductA

sender:Faxsender:Faxsender:Faxsender:Fax receiver:Faxreceiver:Fax receiver:Faxreceiver:Fax

mgr:FaxMgrmgr:FaxMgrmgr:FaxMgrmgr:FaxMgr

Page 20: IBM Software Group ® Clic k to edit Ma ster sub title styl e An Introduction to UML 2.0 Bran Selic IBM Distinguished Engineer IBM Rational Software – Canada.

2828 IBM Software Group |

Summary: UML 2.0Summary: UML 2.0

First major revision of UML Primarily motivated by the need to better support MDD

Characterized by Modular language structure Increased semantic precision and conceptual clarity Recursive concepts definition for scalability Small number of new modeling features – selected to better

support scalability• Structured classes for architectural specifications• Complex and reusable interactions modeling• Sophisticated functional modeling capabilities (activities)

First major revision of UML Primarily motivated by the need to better support MDD

Characterized by Modular language structure Increased semantic precision and conceptual clarity Recursive concepts definition for scalability Small number of new modeling features – selected to better

support scalability• Structured classes for architectural specifications• Complex and reusable interactions modeling• Sophisticated functional modeling capabilities (activities)

Page 21: IBM Software Group ® Clic k to edit Ma ster sub title styl e An Introduction to UML 2.0 Bran Selic IBM Distinguished Engineer IBM Rational Software – Canada.

2929 IBM Software Group |

QUESTIONS?([email protected])

QUESTIONS?([email protected])