A UML Profile for Modeling Complex A UML Profile for Modeling - - PowerPoint PPT Presentation
A UML Profile for Modeling Complex A UML Profile for Modeling - - PowerPoint PPT Presentation
A UML Profile for Modeling Complex A UML Profile for Modeling Complex Real-Time Architectures Real-Time Architectures Bran Selic Bran Selic Rational Software Inc. Rational Software Inc. bselic@rational.com bselic@rational.com Overview
Overview Overview
! Complex real-time systems ! Requirements for modeling real-time system architectures ! Architectural modeling constructs in UML ! Summary ! Complex real-time systems ! Requirements for modeling real-time system architectures ! Architectural modeling constructs in UML ! Summary
Complex Real-Time Systems 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 telecom (e-business infrastructure and internet access devices), defense, aerospace, and industrial control ! 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 telecom (e-business infrastructure and internet access devices), defense, aerospace, and industrial control
Modeling Requirements for Complex Systems Modeling Requirements for Complex Systems
! This complexity requires focussed modeling support in at least the following areas:
" Timeliness and performance modeling " Time-aware communication models " Concurrency management " Resource modeling " Distributed system modeling " Fault tolerance (detection, treatment, analysis, recovery) " Architectural modeling
! This complexity requires focussed modeling support in at least the following areas:
" Timeliness and performance modeling " Time-aware communication models " Concurrency management " Resource modeling " Distributed system modeling " Fault tolerance (detection, treatment, analysis, recovery) " Architectural modeling
(Run-Time) Architecture (Run-Time) Architecture
! An abstract view of a system that identifies only the important elements and relationships ! We will focus only on run-time architectures: The run-time organization of significant software components interacting through interfaces, those components being composed of successively smaller components and interfaces ! An abstract view of a system that identifies only the important elements and relationships ! We will focus only on run-time architectures: The run-time organization of significant software components interacting through interfaces, those components being composed of successively smaller components and interfaces
Why Architecture is Important Why Architecture is Important
! Enables communication between stakeholders
" exposes how individual requirements are handled
! Drives system construction
" decomposition into units of responsibility and parallel development
! Determines a system’s capacity for evolutionary growth ! Enables communication between stakeholders
" exposes how individual requirements are handled
! Drives system construction
" decomposition into units of responsibility and parallel development
! Determines a system’s capacity for evolutionary growth
A A A C C C B B B Mediator Mediator Mediator X X X A A A C C C B B B X X X A A A C C C B B B Mediator Mediator Mediator
Behavior Behavior
Services Layer Services Layer Application Layer Application Layer
TerminalA TerminalA TerminalA TerminalB TerminalB TerminalB Channel1 Channel1 Channel1 Channel2 Channel2 Channel2
Structure Structure Structure
Example Real-Time Architecture Spec Example Real-Time Architecture Spec
! Example telecom system architecture ! Example telecom system architecture
Part Part Part
composition (existence dependency) composition (existence dependency) composition (existence dependency)
Basic Run-Time Architectural Patterns Basic Run-Time Architectural Patterns
! Containment: ! Containment:
aggregation (information hiding) aggregation (information hiding) aggregation (information hiding) Layer N+1 Layer N+1 Layer N+1 Layer N Layer N Layer N
Container Container Container Part Part Part Container Container Container Part Part Part PartB PartB PartB PartA PartA PartA
! Peer-to-peer communication: ! Peer-to-peer communication: ! Layering ! Layering
Architectural Component Design Architectural Component Design
System2 System2 System2 System1 System1 System1
Library Library Library TerminalA TerminalA TerminalA TerminalB TerminalB TerminalB Channel1 Channel1 Channel1 Channel2 Channel2 Channel2 TerminalA TerminalA TerminalA Terminal Tester Terminal Terminal Tester Tester Terminal Terminal Terminal Channel Channel Channel Terminal Tester Terminal Terminal Tester Tester
TerminalA TerminalA TerminalA TerminalB TerminalB TerminalB Channel1 Channel1 Channel1 Channel2 Channel2 Channel2 TerminalA TerminalA TerminalA TerminalB TerminalB TerminalB Channel1 Channel1 Channel1
Refining Architectures (Reuse) Refining Architectures (Reuse)
Lab Building Lab Building
ring road ring road ring road
The Fate of Architectures: Architectural Decay The Fate of Architectures: Architectural Decay
! The gradual deterioration of an architecture through seemingly “minor” incremental changes ! The gradual deterioration of an architecture through seemingly “minor” incremental changes
Preserving Architectures Preserving Architectures
! To ensure visibility and enforcement of architectural intent
" the architectural specification must be an integral part of the final implementation " not as documentation, but as part of the actual implementation
! This requires automated translation of the architectural spec into the implementation language
" automated translation is key since any manual intervention breaks enforcement capabilities " an architectural definition language (ADL)
! To ensure visibility and enforcement of architectural intent
" the architectural specification must be an integral part of the final implementation " not as documentation, but as part of the actual implementation
! This requires automated translation of the architectural spec into the implementation language
" automated translation is key since any manual intervention breaks enforcement capabilities " an architectural definition language (ADL)
Encapsulation shell Encapsulation Encapsulation shell shell Ports Ports Ports
Capsules: Architectural Objects Capsules: Architectural Objects
! A special kind of active object ! A special kind of active object
S1 S2 S3 S1 S2 S1
transitionS1toS2: {int x; x = 0; p2.send(s1); p3.send(s2); … }; transitionS1toS2: {int x; x = 0; p2.send(s1); p3.send(s2); … };
Capsules: Internal Behavior Capsules: Internal Behavior
! Optional hierarchical state machine (event handler with run-to-completion semantics) ! Optional hierarchical state machine (event handler with run-to-completion semantics)
«capsule»
CapsuleClassX
«capsule» «capsule»
CapsuleClassX CapsuleClassX
#counter : int #x : char #counter : #counter : int int #x : char #x : char ports +portB : ProtocolA::master +portC : ProtocolB ports ports + +portB portB : ProtocolA::master : ProtocolA::master + +portC portC : ProtocolB : ProtocolB
Capsules: UML Modeling Capsules: UML Modeling
! Stereotype of Class concept («capsule») with specialized (executable) semantics ! Class diagram representation: ! Stereotype of Class concept («capsule») with specialized (executable) semantics ! Class diagram representation:
call call call ack ack ack time time time number number number call call call ack ack ack talk talk talk transfer transfer transfer Caller Caller Caller Operator Operator Operator Callee Callee Callee
Protocols: Reusable Behavior Patterns Protocols: Reusable Behavior Patterns
! Interaction contracts between capsules
" e.g., operator-assisted call
! Interaction contracts between capsules
" e.g., operator-assisted call
OperatorAssisted Call OperatorAssisted OperatorAssisted Call Call
Alice Alice Alice Charlie Charlie Charlie Bob Bob Bob
caller caller caller callee callee callee
- perator
- perator
- perator
initial initial connected connected connecting connecting
protocol state machine protocol state machine protocol state machine
caller caller
- perator
- perator
callee callee
significant sequences significant sequences significant sequences
Dexter Dexter Dexter
Protocol Specifications Protocol Specifications
! A collaboration that may be required on multiple
- ccasions and situations
! A collaboration that may be required on multiple
- ccasions and situations
signal signal signal source source source call call call caller caller caller number number number caller caller caller ack ack ack callee callee callee Incoming signals Incoming signals Incoming signals signal signal signal target target target call call call callee callee callee transfer transfer transfer caller caller caller ack ack ack caller caller caller Outgoing signals Outgoing signals Outgoing signals
OperatorRole OperatorRole OperatorRole
initial initial connected connected connecting connecting
protocol state machine protocol state machine protocol state machine
caller caller
- perator
- perator
callee callee
significant sequences significant sequences significant sequences
Protocol Roles Protocol Roles
! Specifies one party in a protocol ! Specifies one party in a protocol
Protocol Refinement Protocol Refinement
! Using standard inheritance ! Using standard inheritance
signal signal signal source source source call call call caller caller caller number number number caller caller caller ack ack ack callee callee callee Incoming signals Incoming signals Incoming signals signal signal signal target target target call call call callee callee callee transfer transfer transfer caller caller caller ack ack ack caller caller caller Outgoing signals Outgoing signals Outgoing signals
OperatorRole OperatorRole OperatorRole
signal signal signal source source source call call call caller caller caller number number number caller caller caller ack ack ack callee callee callee Incoming signals Incoming signals Incoming signals signal signal signal target target target call call call callee callee callee transfer transfer transfer caller caller caller ack ack ack caller caller caller Outgoing signals Outgoing signals Outgoing signals reply reply reply caller caller caller query query query caller caller caller
Extended OperatorRole Extended Extended OperatorRole OperatorRole
Environment Environment Environment
Capsule Capsule
S1 S1 S2 S2
Each port is typed with a single protocol role
Ports Ports
! Fully isolate a capsule’s implementation from its environment (in both directions) ! Fully isolate a capsule’s implementation from its environment (in both directions)
Ports and Protocols Ports and Protocols
! Each port realizes a protocol role
" corresponds to the “type” of the port that can be used for static type checking " extension of the traditional object interface concept with a dynamic aspect
! Each port realizes a protocol role
" corresponds to the “type” of the port that can be used for static type checking " extension of the traditional object interface concept with a dynamic aspect
«capsule» «capsule»
CapsuleClassX CapsuleClassX
+portA : ProtocolA::master +portA : ProtocolA::master # #portB portB : ProtocolB : ProtocolB +portC : ProtocolB~ +portC : ProtocolB~ ports ports
«capsule»
/anX:CapsuleClassX
«capsule» «capsule»
/ /anX anX:CapsuleClassX :CapsuleClassX
portA : ProtocolA::master portA : ProtocolA::master «port» «port»
/ /portA portA: :ProtocolA ProtocolA::master ::master
1 1
Ports: Collaboration Diagram Notation Ports: Collaboration Diagram Notation
! Shorthand notation for capsule instances
" iconified form
! Shorthand notation for capsule instances
" iconified form
Connectors model communication channels Each connector supports a single protocol Static typing rules apply (compatible protocols) Connectors model communication channels Connectors model communication channels Each connector supports a single protocol Each connector supports a single protocol Static typing rules apply (compatible protocols) Static typing rules apply (compatible protocols)
«capsule»
sender : Fax
«capsule» «capsule»
sender : Fax sender : Fax
remote:FaxProt remote: remote:FaxProt FaxProt «capsule»
receiver : Fax
«capsule» «capsule»
receiver : Fax receiver : Fax
remote:FaxProt remote: remote:FaxProt FaxProt
Connector Connector Connector
Collaborating Capsules Collaborating Capsules
! Using connectors ! Using connectors
FaxCall FaxCall FaxCall «capsule» /sender:Fax «capsule» «capsule» /sender:Fax /sender:Fax
remote:FaxProt remote: remote:FaxProt FaxProt
«capsule» /receiver:Fax «capsule» «capsule» /receiver:Fax /receiver:Fax
remote:FaxProt remote: remote:FaxProt FaxProt receiveCtrl : Control receiveCtrl receiveCtrl : Control : Control sendCtrl : Control sendCtrl sendCtrl : Control : Control
Relay port Relay Relay port port
c : Control c : Control c : Control c : Control c : Control c : Control
Composition: Structural Patterns Composition: Structural Patterns
f1:FaxCall f1:FaxCall
«capsule» sender:Fax «capsule» «capsule» sender:Fax sender:Fax «capsule» receiver:Fax «capsule» «capsule» receiver:Fax receiver:Fax
f1 := create(FaxCall); f1 := create( f1 := create(FaxCall FaxCall); );
Composite Capsule Semantics Composite Capsule Semantics
! Run-time assertion: the complete internal structure of a composite is automatically created (recursively, if necessary) when the capsule is created ! Run-time assertion: the complete internal structure of a composite is automatically created (recursively, if necessary) when the capsule is created
Benefits of Run-Time Assertion Benefits of Run-Time Assertion
! Architectural enforcement: only explicitly prescribed architectural structures can be instantiated
" it is not possible to bypass (corrupt) the architecture by low- level programming
! Simplification: low-level program code that dynamically creates (destroys) components and the connections between them is eliminated
" in some systems this can be as much as 35% of all code
! Major net gain in productivity and reliability ! Architectural enforcement: only explicitly prescribed architectural structures can be instantiated
" it is not possible to bypass (corrupt) the architecture by low- level programming
! Simplification: low-level program code that dynamically creates (destroys) components and the connections between them is eliminated
" in some systems this can be as much as 35% of all code
! Major net gain in productivity and reliability
Why Do We Need Capsules? Why Do We Need Capsules?
! Won’t “regular” objects do?
" Composite capsules explicitly capture complex structural patterns of concurrent objects
- Structural assertions (enforced architectural intent)
- Multiple levels of decomposition, if necessary
" Ports through protocols bind complex high-level interactions to objects " Capsules have distinct interfaces for different collaborators
- Interfaces are objects with state and identity
- Suitable for distributed system modeling
" Capsules can model layering relationships
! Won’t “regular” objects do?
" Composite capsules explicitly capture complex structural patterns of concurrent objects
- Structural assertions (enforced architectural intent)
- Multiple levels of decomposition, if necessary
" Ports through protocols bind complex high-level interactions to objects " Capsules have distinct interfaces for different collaborators
- Interfaces are objects with state and identity
- Suitable for distributed system modeling
" Capsules can model layering relationships
«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