Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification...

39
California Institute for Telecommunications and Information Technologies La Jolla, CA 92093-0405, USA Department of Computer Science & Engineering University of California, San Diego La Jolla, CA 92093-0114, USA Modeling SW-Architectures using UML-RT/UML 2.0 Ingolf H. Krueger [email protected]

Transcript of Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification...

Page 1: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

California Institute for Telecommunications and Information TechnologiesLa Jolla, CA 92093-0405, USA

Department of Computer Science & EngineeringUniversity of California, San Diego

La Jolla, CA 92093-0114, USA

Modeling SW-Architectures using UML-RT/UML 2.0

Ingolf H. [email protected]

Page 2: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 2February 4, 2003 CSE/CAL·(IT)2

Overview

• UML: Good Enough for Specifying Architectures?

• UML-RT/UML 2.0 – Overview

– Capsules

– Ports and Connectors

– Protocols

– Behavior Description

– Evaluation

• Example: Autononomous Transport System

• Summary and Outlook

Page 3: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 3February 4, 2003 CSE/CAL·(IT)2

Is the UML Good Enough?

• The UML offers a plethora of description techniques for many aspects

of software architectures

• The UML has, however, also significant deficits especially when it

comes to modeling complex, service-oriented systems!

• In particular, we miss:

– An adequate notation for services

– A non-technical component notion

– Clear concepts for hierarchy

– Strong concepts and description techniques for

• logical component distribution

• non-technical interfaces

– Formal means for behavior descriptions with respect to interfaces

Page 4: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 4February 4, 2003 CSE/CAL·(IT)2

Overview

• UML: Good Enough for Specifying Architectures?

• UML-RT/UML 2.0 – Overview

– Capsules

– Ports and Connectors

– Protocols

– Behavior Description

– Evaluation

• Example: Autononomous Transport System

• Summary and Outlook

Page 5: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 5February 4, 2003 CSE/CAL·(IT)2

What is UML-RT?

• Examples of “profiles” of the UML:– embedded real-time systems (“UML-RT”)– automotive– web applications– ...

• Origin: ROOM [SGW94] + UML

• Focus of UML-RT/ROOM:– component-oriented development– all components are potentially active units– signal-/message-oriented communication– time concept– quality of service (in preparation)

Read: UML with component notion

Page 6: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 6February 4, 2003 CSE/CAL·(IT)2

The Component Model of UML-RT

Description Techniques of UML-RT for Structure and Behavior

behaviorstructure

capsules

ports

connectors

UML-statecharts

MSCs

Page 7: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 7February 4, 2003 CSE/CAL·(IT)2

Hierarchical Composition in UML-RT

«capsule»:CLS

«capsule»:CommandSource

«capsule»:CommandHandler

«capsule»:MotorControl

Capsule• active object or “passive”

container• communication with the

environment• signal-based

(asynchronous message exchange)

• exclusively via interface objects (ports)

• supports hierarchical composition

«capsule»lm:Motorrm:Motor«capsule»«capsule»

lm:Motor

Port• concrete realization of an

interface by means of an object• equipped with a protocol

• list of incoming/outgoing messages/signals

• (signal flow)• the aid for “encapsulation” and

“separation of concerns”

Connector• communication link between ports• “drives” protocol

Page 8: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 8February 4, 2003 CSE/CAL·(IT)2

Example: UML-statecharts

«capsule»:CLS

«capsule»:CommandHandler

«capsule»:MotorControl

l rh

UNLD

wldh.lock/l.downl.ready/r.down

wrd

LCKD

r.ready/h.done

wru wlur.ready/h.donel.ready/r.up

h.unlock/l.up

Page 9: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 9February 4, 2003 CSE/CAL·(IT)2

Signal-Based Communication

• Capsules receive and send signals via their ports• Signals, which cannot be processed immediately, are

stored in a queue

«capsule»:CLS

«capsule»:CommandHandler

«capsule»:MotorControl

lock unlock lock

Page 10: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 10February 4, 2003 CSE/CAL·(IT)2

Overview

• UML: Good Enough for Specifying Architectures?

• UML-RT/UML 2.0 – Overview

– Capsules

– Ports and Connectors

– Protocols

– Behavior Description

– Evaluation

• Example: Autononomous Transport System

• Summary and Outlook

Page 11: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 11February 4, 2003 CSE/CAL·(IT)2

Capsules

• Every capsule represents a potentially active object

• Communication between capsule and environment: exclusively via ports– no public data– no public methods

• Hierarchical decomposition into sub-capsules

• Every capsule has (at most) one state automaton describing the capsule’s behavior⇒ capsule is “controller” for its sub-capsules⇒ see architectural pattern “recursive control”

Page 12: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 12February 4, 2003 CSE/CAL·(IT)2

Capsules

• Upon its instantiation a capsule builds its internal structure (sub-capsules)

• The capsule can change its internal structure over time⇒ Architectural integrity

«capsule»CLS

ports

cp : CommandHandler

mp[2] : Initiator

Capsule

Name of Capsule

Port Name

Protocol Role

Page 13: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 13February 4, 2003 CSE/CAL·(IT)2

Overview

• UML: Good Enough for Specifying Architectures?

• UML-RT/UML 2.0 – Overview

– Capsules

– Ports and Connectors

– Protocols

– Behavior Description

– Evaluation

• Example: Autononomous Transport System

• Summary and Outlook

Page 14: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 14February 4, 2003 CSE/CAL·(IT)2

Ports and Connectors

• Port– belongs to precisely one capsule

(the capsule creates and destroys its ports)– has identity and state– has behavior– implements the role of its capsule in a protocol

• Kinds of ports– Relay-Ports

• relay signals between capsules and their sub-capsules• controlled interface export

– End-Ports• relay signals between capsules and their state automata• have queues for signals already received, but not yet processed

Page 15: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 15February 4, 2003 CSE/CAL·(IT)2

Ports and Connectors

Simplified Representation

«capsule»CLS

ports

cp : CommandProtocol.Handler;

mp[2] : MotorProtocol.Initiator;

Protocol-Role(qualified with protocol name)

Port Name

Page 16: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 16February 4, 2003 CSE/CAL·(IT)2

Ports and Connectors

Simplified Representation in Collaboration Diagrams

«capsule»:CLS

«capsule»lm:Motor«capsule»rm:Motor

«capsule»lm:Motor

«capsule»:CommandSource

mp[1]:MotorProtocol.Initiator

mp[2]:MotorProtocol.Initiator

cp:CommandProtocol.Handler

Port Symbol

Port Name and Protocol-Role

Page 17: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 17February 4, 2003 CSE/CAL·(IT)2

Ports and Connectors

«capsule»:CLS

«capsule»lm:Motor«capsule»rm:Motor

«capsule»lm:Motor

«capsule»:CommandHandler

«capsule»:MotorControl

End-Port

Relay-PortRelay-Port

Page 18: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 18February 4, 2003 CSE/CAL·(IT)2

Overview

• UML: Good Enough for Specifying Architectures?

• UML-RT/UML 2.0 – Overview

– Capsules

– Ports and Connectors

– Protocols

– Behavior Description

– Evaluation

• Example: Autononomous Transport System

• Summary and Outlook

Page 19: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 19February 4, 2003 CSE/CAL·(IT)2

Protocols

Example: Simple Communication Protocol

«protocolRole»SenderRole

incomingack_startack_dataack_end

outgoingreq_start

datareq_end

«protocolRole»ReceiverRole

incomingreq_start

datareq_end

outgoingack_startack_dataack_end

req_startack_start

data

data

req_end

ack_data

ack_data

ack_end

ReceiverRoleSenderRole

Page 20: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 20February 4, 2003 CSE/CAL·(IT)2

Protocols

Example: Simple Communication Protocol

«protocolRole»ReceiverRole

incomingreq_start

datareq_end

outgoingack_startack_dataack_end

«protocolRole»ReceiverRole

incomingreq_start

datareq_end

outgoingack_startack_dataack_end

«protocolRole»SenderRole

incomingack_startack_dataack_end

outgoingreq_start

datareq_end

“Conjugated” sender role

Page 21: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 21February 4, 2003 CSE/CAL·(IT)2

Protocols

Simplification for Point-to-Point Protocols

«protocol»Transmission

incomingack_startack_dataack_end

outgoingreq_start

datareq_end

Base Role for Protocol(Sender View)

«capsule»Receiver

«capsule»Sender

rp:Transmission~

sp:Transmission

Base Role

Conjugated (Inverse) Role

Page 22: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 22February 4, 2003 CSE/CAL·(IT)2

Overview

• UML: Good Enough for Specifying Architectures?

• UML-RT/UML 2.0 – Overview

– Capsules

– Ports and Connectors

– Protocols

– Behavior Description

– Evaluation

• Example: Autononomous Transport System

• Summary and Outlook

Page 23: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 23February 4, 2003 CSE/CAL·(IT)2

Behavior Description in UML-RT

• Every capsule that has its own behavior is associated with a UML-statechart

• Max one statechart per capsule

• Hierarchical composition: – every sub-capsule can have its own statechart

Page 24: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 24February 4, 2003 CSE/CAL·(IT)2

Behavior Description in UML-RT

Doing without AND-states

• Concurrency via separate capsules

• Synchronization via explicit communication

• Result: stronger decoupling

Page 25: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 25February 4, 2003 CSE/CAL·(IT)2

Behavior Description in UML-RT

Encapsulation on the Level of States

/a2e1/a1

exit/ax

/a3

entry/ae

Chain State

e1/a1

exit/ax

• States become exchangeable entities

• Helps avoid “stub states”

Page 26: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 26February 4, 2003 CSE/CAL·(IT)2

Overview

• UML: Good Enough for Specifying Architectures?

• UML-RT/UML 2.0 – Overview

– Capsules

– Ports and Connectors

– Protocols

– Behavior Description

– Evaluation

• Example: Autononomous Transport System

• Summary and Outlook

Page 27: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 27February 4, 2003 CSE/CAL·(IT)2

Evaluation

• UML-RT is much better suited for the specification of software

architectures and services than “pure” UML:

– hierarchic component model,

precise behavior descriptions

– interface concept

– protocols and connectors

• Potentials for improvement (among others):

– m2m communication instead of p2p

– association of interaction patterns with ports/connectors

– methodological guidelines for iterative service development

• Future:

– (methodological!) treatment of Quality-of-Service aspects

Page 28: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 28February 4, 2003 CSE/CAL·(IT)2

Overview

• UML: Good Enough for Specifying Architectures?

• UML-RT/UML 2.0 – Overview

– Capsules

– Ports and Connectors

– Protocols

– Behavior Description

– Evaluation

• Example: Autononomous Transport System

• Summary and Outlook

Page 29: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 29February 4, 2003 CSE/CAL·(IT)2

Systematic Construction of Reliable SW-Systems

1. Develop/Refine domain model

2. Capture interaction patterns

3. Derive interface specification

• messages/signals, types

• behavior

4. Decompose components hierarchically

Page 30: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 30February 4, 2003 CSE/CAL·(IT)2

Example Application: Autonomous Transport System

MachineTools

• process workpieces

• post jobs to be processed (“deliver workpiece”)

• negotiate with Holons via broadcasting

InStorage

• holds workpieces yet to be processed

Holons

• carry workpieces between source and destination

• negotiate with OutStorage and MachineTools for jobs

• hold internal database representing the system’s status

OutStorage

• holds workpieces after processing

• holds “production plan/program” (number/kind of workpieces to be processed per day)

Page 31: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 31February 4, 2003 CSE/CAL·(IT)2

Example Application: Autonomous Transport System

Architectural Aspects:

MachineTool1 MachineTool2 MachineTool3

Holon1

InStorage OutStorage

Holon2 Holon3

DB

Control

Dispo

• components • p2p communication• interfaces/behavior • broadcasting• hierarchy/decomposition

Page 32: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 32February 4, 2003 CSE/CAL·(IT)2

Domain Model

CommunicationSystem

HTS

Workpiece

Storage

MachineTool

*Status

1

11

Location

0..12

0..1

*

0..1

*

0..1

Database1

Job1 *

*

1

0..1

*

ProdProg1

*

1

1

OutStorageInStorage

CommunicationSystem

*

1

11

Page 33: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 33February 4, 2003 CSE/CAL·(IT)2

Architectural Pattern for Broadcasting

ProdSys

BroadcastSystem

nHTS

nMachineTool

InStorage

OutStorage

BroadcastSystem

HTS_IOSystem

Disponent Database

HTS

SingleJobControl

Page 34: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 34February 4, 2003 CSE/CAL·(IT)2

Sequence Charts for Broadcasting

m:MachineTool h:HTS l:HTS

requestWP()

releaseWP()

drive tolocation 1

jTransporting(jobno)

updateJobStatus()

updateJobStatus()

time

signal exchange

component axislocal action

broadcasting

Page 35: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 35February 4, 2003 CSE/CAL·(IT)2

Sequence Charts for Broadcasting

m:MachineTool h:HTS l:HTS

compute bid

waitingwaiting

compute bid

store job

waitingwaiting

jOrder(jobno)

jBid(jobno, h)

jBid(jobno, l)

jEndOfNegotiation(jobno)

state label

Page 36: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 36February 4, 2003 CSE/CAL·(IT)2

Derivation of Component Structure

Captured scenarios & domain model indicate:

• active vs. passive components

• Point-to-point communication requirements

• broadcasting requirements

ProdSys

BroadcastSystem

nHTS

nMachineTool

InStorage

OutStorage

BroadcastSystem

Page 37: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 37February 4, 2003 CSE/CAL·(IT)2

Derivation of Interface Behavior

Captured scenarios indicate also:

• names and types of signals

• ordering of signal flow

n

HTS

m:MachineTool h:HTS l:HTS

requestWP()

releaseWP()

drive tolocation 1

jTransporting(jobno)

updateJobStatus()

updateJobStatus()

m:MachineTool h:HTS l:HTS

compute bid

waitingwaiting

compute bid

store job

waitingwaiting

jOrder(jobno)

jBid(jobno, h)

jBid(jobno, l)

jEndOfNegotiation(jobno)

Page 38: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 38February 4, 2003 CSE/CAL·(IT)2

Overview

• UML: Good Enough for Specifying Architectures?

• UML-RT/UML 2.0 – Overview

– Capsules

– Ports and Connectors

– Protocols

– Behavior Description

– Evaluation

• Example: Autononomous Transport System

• Summary and Outlook

Page 39: Modeling SW-Architectures using UML-RT/UML 2 · UML-RT/UML 2.0 Ingolf H. Krueger ... Simplification for Point-to-Point Protocols ... • UML-RT is much better suited for the specification

© Ingolf H. Krueger 39February 4, 2003 CSE/CAL·(IT)2

Summary and Outlook

• Modeling “in the real world”:

often – if at all – done using UML/UML-RT/UML 2.0

• UML-RT/UML 2.0 better equipped for modeling software

architectures than UML versions < 2.0

• Starting point for component- and service-oriented

development: domain model, interaction scenarios

• How to avoid over-modeling and over-engineering?