using uml for modeling complex real time system architectures bran selic vp advanced technology...

42
Using UML for Modeling Complex Using UML for Modeling Complex Real Time System Architectures Real Time System Architectures Bran Selic Bran Selic VP Advanced Technology VP Advanced Technology ObjecTime Limited ObjecTime Limited [email protected] [email protected]

Post on 20-Dec-2015

224 views

Category:

Documents


4 download

TRANSCRIPT

Using UML for Modeling Complex Using UML for Modeling Complex Real Time System ArchitecturesReal Time System Architectures

Bran SelicBran Selic

VP Advanced TechnologyVP Advanced Technology

ObjecTime LimitedObjecTime Limited

[email protected]@objectime.com

Bran Selic2

Overview

• The Unified Modeling Language (UML)

• Complex real-time systems

• Requirements for modeling architectures of

complex RT systems

• Approach and method

• Architectural modeling constructs

• Summary

Bran Selic3

The Unified Modeling Language

• A general purpose OO modeling language » combines a number of proven methods

OMT(Rumbaugh)

Booch

OOSE(Jacobson)

UML0.9

1996

Catalysis ROOM etc.

UML1.1

Nov. 1997

UML1.4

Mar. 1999

Bran Selic4

What is (in) the UML Standard?

• Semi-formal semantic meta-model

» defines basic modeling concepts

object, class, etc.

» includes well-formedness rules expressed as formal constraints in Object Constraint Language (OCL)

• Graphical notation for modeling concepts

» 8 different diagram types

• Two predefined domain extensions

Bran Selic5

The UML Meta-Model–Example

GeneralizeableElement

isRoot:BooleanisLeaf:BooleanisAbstract:Boolean

Classifier

Feature

visibility:{public, protected, private}

Class

isActive:Boolean

*

not self.isAbstract implies self.allOperations->forAll(op | self.allMethods->exists(m | m.specification includes (op)))

(Meta)class

Generalization association

Compostion association

OCL constraint

Bran Selic6

• The Unified Modeling Language (UML)

• Complex real-time systems

• Requirements for modeling architectures of

complex RT systems

• Approach and method

• Architectural modeling constructs

• Summary

Bran Selic7

General Real-Time Systems

• A system that maintains a continuous timely interaction with its environment

environment

inputs outputsReal-TimeSystem

(state)

outputs = f (inputs, state)

Bran Selic8

Complex Real-Time Systems

• Complex real-time systems characterized by:

» extreme dependability (reliability, availability)

» diverse and feature-rich functionality

» continuous feature upgrades (evolutionary

requirements)

» physical distribution

• Encountered mostly in telecommunications,

defense, aerospace, and industrial control

Bran Selic9

Modeling Requirements for Complex RT Systems

• This complexity requires focussed modeling support in at least the following areas:

» Architectural modeling» Timeliness and performance modeling» Time-aware communication models» Concurrency management» Resource modeling» Distributed system modeling» Fault-tolerance techniques

Bran Selic10

• The Unified Modeling Language (UML)

• Complex real-time systems

• Requirements for modeling architectures of

complex RT systems

• Approach and method

• Architectural modeling constructs

• Summary

Bran Selic11

Real-Time Software Architectures

• Architecture:

The organization of significant software components interacting through interfaces, those components being composed of successively smaller components and interfaces

• It is the key to success in:

» the initial construction of a system

» system evolution

Bran Selic12

Architectures and Evolution

• Two functionally equivalent initial architectures:

A

CB

Mediator

XA

CB

XA

CB

Mediator

Bran Selic13

Real-Time Architectural Specifications

• Example telecom system architecture

BehaviorServices Layer

Application Layer

TerminalA TerminalB

Channel1

Channel2

Structure

Bran Selic14

Architectural Component Design

System2

System1Library

TerminalA TerminalB

Channel1

Channel2

TerminalATerminal

Tester

Terminal

Channel

TerminalTester

Bran Selic15

Refining Architectures (Reuse)

Channel2

TerminalA TerminalB

Channel1

TerminalA TerminalB

Channel1

Bran Selic16

Summary: Requirements for Architectural Modeling

• The ability to model and enforce:

» large-grain (architectural) components

and their interfaces

» structural compositions of architectural

components

» dynamic interaction patterns between

architectural components

» refinement of architectures

Bran Selic17

• The Unified Modeling Language (UML)

• Complex real-time systems

• Requirements for modeling architectures of

complex RT systems

• Approach and method

• Architectural modeling constructs

• Summary

Bran Selic18

Approach and Method

• The necessary architectural modeling capabilities can be found in ROOM

• Express the architectural modeling concepts of ROOM using standard UML

• Domain-specific library of UML “macros”

UML Modeling Concepts

Real-TimeModelingLibrary

(UML-RT)

BusinessModelingLibrary

...

Bran Selic19

UML Extensibility Mechanisms

• Stereotypes, constraints, tagged values

Capsule

<“ports” >

not self.isAbstract implies self.allOperations->forAll(op | self.allMethods->exists(m | m.specification includes (op)))

Class

isActive:Boolean

stereotype

required tag

Constraint (OCL)

Bran Selic20

Real-Time Object-Oriented Modeling (ROOM)

• Domain-specific (real-time) concepts

» dynamic high-level structures

» reactive behavior (ROOMcharts)

• Executable (formal) models

• Full automatic code generation

• Field proven in a large number (>100) of large-scale industrial projects

• Tool support available (ObjecTime Limited and Rational Software)

Bran Selic21

Phasing

• Basic modeling capabilities (UML 1.1)» structural pattern modeling (collaboration

diagrams)» state machine modeling

• Real-time specific constructs » architectural modeling (March ‘98)» other constructs (-June ‘99)» collaboration: ObjecTime & Rational

• OMG standardization (1999/2000)» RT analysis and design WG

Bran Selic22

• The Unified Modeling Language (UML)

• Complex real-time systems

• Requirements for modeling architectures of

complex RT systems

• Approach and method

• Architectural modeling constructs

• Summary

Bran Selic23

Capsules: Architectural Objects

• Active objectsEncapsulationshell

Ports

Bran Selic24

Capsules: Behavior

• Optional hierarchical state machine (signal handler with run-to-completion semantics)

S1

S2 S3

S1

S2

S1

transitionS1toS2: {int x; x = 0; p2.send(s1); p3.send(s2); … };

Bran Selic25

Capsules: UML Modeling

• Stereotype of Class concept («capsule») with specialized (executable) semantics

• Class diagram representation:

«capsule»CapsuleClassX

#counter : int#x : char

+portB : ProtocolA::master#portC : ProtocolB

ports

Bran Selic26

Protocols: Contractual Behavior Patterns

• Interaction contracts between capsules» e.g., operator-assisted call

call

ack

time

number

call

ack

talk

transfer

Caller Operator Callee

Bran Selic27

OperatorAssistedCall

Alice

Charlie

Bobcaller callee

operatorinitial

connected

connecting

protocol state machine

caller operator callee

significant sequences

Protocol Specifications

• A special form of collaboration

Dexter

Bran Selic28

Protocol Roles

• Specifies one party in a protocol

signal source

call caller

number caller

ack callee

Incoming signals

signal target

call callee

transfer caller

ack caller

Outgoing signals

OperatorRole

caller operator callee

significant sequences

initial

connected

connecting

role state machine

Bran Selic29

Protocol Refinement

• Using inheritance

signal source

call caller

number caller

ack callee

Incoming signals

signal target

call callee

transfer caller

ack caller

Outgoing signals

OperatorRolesignal source

call caller

number caller

ack callee

Incoming signals

signal target

call callee

transfer caller

ack caller

Outgoing signals

ExtendedOperatorRole

query caller

reply caller

Bran Selic30

Protocols: UML Modeling

• Collaboration stereotype: «protocol»• Classifier Role stereotype: «protocolRole»

«protocol»OperatorAssisted

Call

«protocolRole»caller

acktransfer

incoming

callnumbertalk

outgoing

«protocolRole»callee

«protocolRole»operator

1

1 1

Bran Selic31

Ports: Boundary Objects

• Fully isolate a capsule’s implementation from its environment (in both directions)

Environment

Capsule

S1

S2

Created and destroyed along with their capsule

Bran Selic32

Ports and Protocols

• Each port realizes a single protocol role (type)

» Multiple ports with same type possible

«capsule»CapsuleClassX

+portA : ProtocolA::master#portB : ProtocolB+portC : ProtocolB~

ports

Bran Selic33

Ports: Collaboration Diagram Notation

• Shorthand notation for capsule instances» iconified form

«capsule»anX:CapsuleClassX

portA : ProtocolA::master

portC : ProtocolB~

«port»portA:ProtocolA::master

1

Bran Selic34

Combining Capsules

• Using connectors

Connectors model communication channelsEach connector supports a single protocolStatic typing rules apply (compatible protocols)Modeled as association classes in UML

«capsule»sender : Fax

remote : FaxProt«capsule»

receiver : Faxremote : FaxProt

Connector

Bran Selic35

FaxCall

«capsule»sender:Fax

remote:FaxProt

c : Control

«capsule»receiver:Fax

Remote:FaxProt

c : Control

receiveCtrl : ControlsendCtrl : Control

Relayport

Composition: Structural Patterns as (Reusable) Dynamic Components

• The composite is also a first-class object!

Bran Selic36

Composite Capsule Semantics

• Architectural assertion mechanism: the static elements of the internal structure of a composite capsule are automatically created (and destroyed) along with the capsule

» applies recursively down to the innermost leaf capsule level

» only explicitly prescribed architectural structures can be instantiated

• This also significantly reduces the complexity of the model since all the code used to establish these structures is eliminated

Bran Selic37

«capsule»sender:Fax

c : Control

«capsule»receiver:Fax

c : Control

End Ports: Where Structure and Behavior Meet

• Ports directly connected to the state machine

receiveCtrl : Control~senderCtrl : Control~

c : SystemControl

initial

connected

connecting

capsule state machine

Public End PortImplementationEnd Port

Bran Selic38

Decomposition: Class Diagram View

• Alternative representation » More abstract

«capsule»Fax

«capsule»FaxCall

1 receiver

1

sender

Bran Selic39

• The Unified Modeling Language (UML)

• Complex real-time systems

• Requirements for modeling architectures of

complex RT systems

• Approach and method

• Architectural modeling constructs

• Summary

Bran Selic40

Summary (1)

• Complex real-time systems phenomena require specialized modeling support

• The ROOM language has industry-proven support for modeling complex real-time architectures

• The benefits of both UML and ROOM are gained by expressing the ROOM constructs as UML stereotypes

» UML-RT : a UML extension for the complex real-time domain

Bran Selic41

Summary (2)

• Only four UML stereotypes are sufficient (include formally defined constraints that ensure consistency/executability)

Stereotype UML Metaclass

«protocol» Collaboration

«protocolRole» ClassifierRole

«port» Class

«capsule» Class

supplemented by an optional custom notation

Bran Selic42

Bibliography

• Real-time architectural modeling whitepaper

by B. Selic and J. Rumbaugh:» http://www.objectime.com

• OMG’s UML 1.1 standard» http://www.rational.com

• ROOM» B. Selic, G. Gullekson, and P. Ward,

“Real-Time Object-Oriented Modeling”,» John Wiley & Sons, NY, 1994.