ontologies reasoning components agents simulations architectural modeling with uml2 composite...

24
Ontologi es Reasonin g Component s Agents Simulatio ns Architectural Modeling Architectural Modeling with with UML2 Composite UML2 Composite Structures and Structures and Components Components Jacques Robin

Upload: isabella-bennett

Post on 14-Jan-2016

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Ontologies Reasoning Components Agents Simulations Architectural Modeling with UML2 Composite Structures and Components Jacques Robin

OntologiesReasoningComponentsAgentsSimulations

Architectural Modeling Architectural Modeling withwith

UML2 Composite UML2 Composite Structures and Structures and ComponentsComponents

Jacques Robin

Page 2: Ontologies Reasoning Components Agents Simulations Architectural Modeling with UML2 Composite Structures and Components Jacques Robin

OutlineOutline

UML2 Structured Classifiers Key Concepts Concrete Visual Syntax and Examples Meta-Model Link between Meta-Model and Visual Syntax

UML2 Encapsulated Classifiers Key Concepts Concrete Visual Syntax and Examples Meta-Model Link between Meta-Model and Visual Syntax

UML2 Components Key Concepts Concrete Visual Syntax and Examples Meta-Model Link between Meta-Model and Visual Syntax

Page 3: Ontologies Reasoning Components Agents Simulations Architectural Modeling with UML2 Composite Structures and Components Jacques Robin

UML2 Structured ClassifiersUML2 Structured Classifiers

New to UML2 A UML2 structured classifier C can have special properties called parts

that can be connected within the containing context of C to realize one of its behaviors

The part-whole relationship between a part and its containing structured classifier is distinct but derived from the composition relationship between a class and its composite containing class Whereas a composition property of a kernel classes represents a context-

independent relationship from the kernel “whole” class to the “part” class, the part property of a structured classifier represents a context-dependent

relationship from a structured “whole” class to the “part” class Similarly, the connection relationship between two parts of a

containing structured classifier is distinct but derived from the association relationship between two classes Whereas an association represents a context-independent relationships

between two classes, the connection between two classes that are parts of a containing

structured classifier is valid only within the context of this container

Page 4: Ontologies Reasoning Components Agents Simulations Architectural Modeling with UML2 Composite Structures and Components Jacques Robin

Name

Attributes

Operations

NestedClassifiers

Parts

UML2 Structured Classifier UML2 Structured Classifier CompartmentsCompartments

Nested Classes, Components, Interfaces &Associations linking their attributes,Realizations, Usages & GeneralizationsEncapsulated within containing Kernel::Class

Classes, Components, Interfaces &Connectors linking them as partsor elements connected to parts incontext of containingCompositeStructures::Class

Page 5: Ontologies Reasoning Components Agents Simulations Architectural Modeling with UML2 Composite Structures and Components Jacques Robin

Composed Class x Structured ClassComposed Class x Structured Class

Composition: context independentwhole-part relationship

Association: context independentrelationship

StructuredClass/Part: context-dependentwhole-part relationship

Connector: relationshipdependent ofcontainingStructuredClass

StructuredClass/ClassConnectedToPart: relationshipdependent ofcontainingStructuredClass

Parts Compartment

Page 6: Ontologies Reasoning Components Agents Simulations Architectural Modeling with UML2 Composite Structures and Components Jacques Robin

*

Structured Class: Meta-ModelStructured Class: Meta-Model

StructuredClassifier

Classifier

ConnectableElement

TypedElement

StructuralFeature

Property

Connector

0..1 ownedAttribute *

0..1 /part *

0..1 ownedConnector *ConnectorEnd

role

/definingEnd

Associationtype

0..1 attribute *

0..1 partWithPort

redfinedConnector

*2..**

Type

Kernel::Class

0..1 type

/role

MultiplicityElementFeature

EncapsulatedClassifier

EncapsulatedClassifiers::Class

Page 7: Ontologies Reasoning Components Agents Simulations Architectural Modeling with UML2 Composite Structures and Components Jacques Robin

Class x Composite StructureClass x Composite StructureDiagrams: Link to Meta-ModelDiagrams: Link to Meta-Model

CS::Class.nameCS::ClassCS::Class.part = Property

CS::Class.ownedConnector.ConnectorEnd.role = Property

CS::Class.role.upper= CS::Class.role.lower= Integer

CS::Class.ownedConnector.ConnectorEnd = ConnectorEnd

CS::Class.ownedConnector= ConnectorCS::Class.ownedConnector.name

CS::Class.ownedConnector.type.name

CS::Class.role = Property

CS::Class.part.type = K::Class

K::Class

K::Class.ownedAttribute.isComposite = true

K::Class.ownedAttribute.association = Association

K::Class.ownedAttribute.association = Association

K::Class.ownedAttribute.association.name

K::Class.ownedAttribute.upper= K::Class.ownedAttribute.lower

K::Class.name

K::Class.name

K::Class.ownedAttribute.name

Page 8: Ontologies Reasoning Components Agents Simulations Architectural Modeling with UML2 Composite Structures and Components Jacques Robin

Composite Structure Diagram: Composite Structure Diagram: ClassesClasses

Page 9: Ontologies Reasoning Components Agents Simulations Architectural Modeling with UML2 Composite Structures and Components Jacques Robin

Composite Structure Diagram: Composite Structure Diagram: ObjectsObjects

InstanceSpecification

PackageableElement Element

SlotValueSpecification

Classifier

StructuralFeature

LiteralSpecification

InstanceValue

OpaqueExpression

LiteralBoolean

LiteralInteger

LiteralString

LiteralUnlimitedNaturalExpression

0..1

*

0..1 *0..*

*

0..1TypedElement

Class

Page 10: Ontologies Reasoning Components Agents Simulations Architectural Modeling with UML2 Composite Structures and Components Jacques Robin

Composite Structure Diagram: Composite Structure Diagram: ObjectsObjects

InstanceSpecification

PackageableElement Element

SlotValueSpecification

Classifier

StructuralFeature

LiteralSpecification

InstanceValue

OpaqueExpression

LiteralBoolean

LiteralInteger

LiteralString

LiteralUnlimitedNaturalExpression

0..1

*

0..1 *0..*

*

0..1TypedElement

Class

NamedElement

InstanceSpecification.classifier.ownedConnector.name

InstanceSpecification.classifier.nameInstanceSpecification.classifier.parts.role.name

InstanceSpecification.classifier.parts.name

Page 11: Ontologies Reasoning Components Agents Simulations Architectural Modeling with UML2 Composite Structures and Components Jacques Robin

UML2 Encapsulated ClassUML2 Encapsulated Class

New to UML2 Specializes Structured Classifier An instances of an encapsulated class (encapsulated object)

interacts with its environment and its internal parts only through typed interaction points called ports

A port is an interaction point specification used by an encapsulated class to either: Provide a service to its environment specified by a provided

interface that types the port Request a service from its environment specified by a requested

interface that types the port Ports provide a second level encapsulation indirection beyond

the first one provided by interfaces: Encapsulated parts are connected indirectly through their ports, whereas simple parts are connected directly.

Page 12: Ontologies Reasoning Components Agents Simulations Architectural Modeling with UML2 Composite Structures and Components Jacques Robin

UML2 PortsUML2 Ports

Ports allow run-time assembly of encapsulated classes into a containing class to compose a complex service from simpler ones

Instantiation of an encapsulated class with internal parts which are recursively encapsulated class is a complex process that involves: Instantiating each nested encapsulated class Instantiating each of their ports into an interaction point Instantiating each of their associations into a connector between two such interaction

points In this internal assembly process, two ports can only be connected only if the

provided interface of one is conformant to the requested interface of the other This conformance can be:

Simple, merely in terms of matching interface types More complex in terms of pre and post-condition constraints on each operation of the

ports’ respective interfaces Even more complex in terms of protocol state machines associated to either the ports

or their interfaces A protocol state machine describes a precise, constrained sequence of

externally visible states through which the encapsulated class can go through It specifies for each state in the sequence the restricted subset of operations that can

be invoked by the encapsulated class’ environment through the provided port It also specifies the next state resulting from the invocation of a given operation in a

given state

Page 13: Ontologies Reasoning Components Agents Simulations Architectural Modeling with UML2 Composite Structures and Components Jacques Robin

Name

Attributes

Operations

NestedClassifiers

Parts

UML2 Encapsulated Classifier UML2 Encapsulated Classifier CompartmentsCompartments

Classes, Connectors linking them throughtheir Ports as parts or elements connected to partsin context of containing CompositeStructures::Class

Nested Classes, Generalizations, Ports, Associations linking their attributes, Encapsulated within containing Kernel::Class

Ports

Page 14: Ontologies Reasoning Components Agents Simulations Architectural Modeling with UML2 Composite Structures and Components Jacques Robin

*

Encapsulated Class: Meta-ModelEncapsulated Class: Meta-Model

StructuredClassifier

Classifier

ConnectableElement

TypedElement

StructuralFeature

Property

Connector

0..1 ownedAttribute *

0..1 /part *

0..1 ownedConnector *ConnectorEnd

role

/definingEnd

Associationtype

0..1 attribute *

0..1 partWithPort

redfinedConnector*2..*

*

Type

Kernel::Class

0..1 type

/role

MultiplicityElementFeature

EncapsulatedClassifier

EncapsulatedClassifiers::Class

Port

ownedPort

Interface

* /required *

* /provided *

redfinedPort

ProtocolStateMachineprotocol

* protocol 0..1

StateMachine

ProtocolConformance0..1 0..1

Relationship

*

*

0..1conformancespecificMachine

generalMachine *

*

Page 15: Ontologies Reasoning Components Agents Simulations Architectural Modeling with UML2 Composite Structures and Components Jacques Robin

Composite Structure Diagram with Composite Structure Diagram with Encapsulated Classes: Link to Meta-ModelEncapsulated Classes: Link to Meta-Model

CS::Class.ownedPort.type= CS::Class.ownedPort.providedInterface-> union(CS::class.ownedPort.requiredInterface)

Class.ownedConnector.ConnectorEnd.partWithPort

Class.ownedConnector.ConnectorEnd.partWithPort.name

Class

Class

Class

Class.ownedPort.providedInterface

Class.ownedPort.requiredInterface

Class.ownedPort.requiredInterface.name

Class.ownedPort.providedInterface.name

Class.ownedPort

Class.ownedPort.name

Class.part Class.part

Class.part Class.part

Class.ownedConnector

Class.ownedConnector.name

Class.ownedConnector.ConnectorEnd

Class.role Class.part.type = Class

Class.ownedConnector.ConnectorEnd.upper = Class.ownedConnector.ConnectorEnd.lower

Class.name

Class.name

Class.name

Page 16: Ontologies Reasoning Components Agents Simulations Architectural Modeling with UML2 Composite Structures and Components Jacques Robin

Composite Structure Diagram with Composite Structure Diagram with Encapsulated Classes: More Encapsulated Classes: More

ExamplesExamples Part multiplicity can also

appear in the top right corner of the part rectangle

The type of a port can also appear after its name and “:”

The multiplicity of a port can also appear after its name or type between “[ ]”

The service provided by an encapsulated class C by connecting to one of its port can be realized either: By one (or several) part(s) of

C By C itself, in this case the

port square is linked by a line to a state appearing inside C’s part compartment

Page 17: Ontologies Reasoning Components Agents Simulations Architectural Modeling with UML2 Composite Structures and Components Jacques Robin

UML2 ComponentsUML2 Components

New to UML2 for all lifecycle stages except deployment Specialize encapsulated classes The behaviors that it provides to its environment are only accessible

through its provided interface(s) The behaviors that it expects its environment to provide to it are only

accessible through its required interface(s) Through these associated interfaces, a UML2 component defines an

abstract behavioral type independent of its realization The interfaces of a UML2 component can be either:

Directly associated to it, or Indirectly associated to it through its ports.

The abstract behavior type specified by a UML2 component can be realized either: Directly by the component itself; Indirectly by the assembly of its internal parts; Indirectly by a set of external classifiers.

A UML2 packageable component specializes a UML2 component by grouping all the artifacts involved in the component specification or realization into a package

Page 18: Ontologies Reasoning Components Agents Simulations Architectural Modeling with UML2 Composite Structures and Components Jacques Robin

UML2 ComponentsUML2 Components

A UML2 component may: Delegate part of the realization of a service that it provides to its

environment to one of its internal parts; Delegate a service request from one of its part to its environment.

Component connectors specialize encapsulated class connectors by: Being associated to a behavior designed by contract

i.e., it guarantees to its environment that all post-conditions of all its provided operations will be satisfied whenever they are called in a way that satisfies all their pre-conditions;

i.e., its environment guarantees that all post-condition of all its requested operations will be satisfied whenever it calls these operations in a way that satisfies all their pre-conditions;

Sub-categorizing into: Delegation connector between a containing component and its parts; Assembly connector between two parts of an containing component

Page 19: Ontologies Reasoning Components Agents Simulations Architectural Modeling with UML2 Composite Structures and Components Jacques Robin

<<component>>Name

Attributes

Operations

NestedClassifiers

Parts

UML2 Component CompartmentsUML2 Component Compartments

Classes, Components, Interfaces &Connectors linking them throughtheir Ports as parts or elementsconnected to parts in context ofcontaining CompositeStructures::Class

Nested Classes, Components, Ports, Interfaces & Associations linking their attributes,Realizations, Usages & GeneralizationsEncapsulated within containing Kernel::Class

Ports

Page 20: Ontologies Reasoning Components Agents Simulations Architectural Modeling with UML2 Composite Structures and Components Jacques Robin

UML2 Component: Meta-ModelUML2 Component: Meta-Model

EncapsulatedClassifier

EncapsulatedClassifiers::Class

Port

ownedPort

Interface

* /required *

* /provided *

redfinedPort

*

*

0..1

Component

/required

/provided

* *

StructuredClassifier

CS::Connector0..1 ownedConnector *

Components::Connector

kind:ConnectorKind

<<enumeration>>ConnectorKind

assemblydelegate

0..1 /ownedConnector *

Behavior

contract *

*ComponentRealization

Realization

0..1

*

PackageableElement

0..1

*packagedElement

Page 21: Ontologies Reasoning Components Agents Simulations Architectural Modeling with UML2 Composite Structures and Components Jacques Robin

Component Diagram without Component Diagram without Interface Operations: Link to Meta-Interface Operations: Link to Meta-

ModelModel

Component

Component.name

Component.providedInterface

Component.providedInterface

Component.providedInterface.name

Component.providedInterface.name

Component.requiredInterface

Component.requiredInterface

Component.requiredInterface

Component.requiredInterface.name

Component.requiredInterface.name

Page 22: Ontologies Reasoning Components Agents Simulations Architectural Modeling with UML2 Composite Structures and Components Jacques Robin

Component Diagram with Interface Component Diagram with Interface Operations: Link to Meta-ModelOperations: Link to Meta-Model

Component

Component.name

InterfaceRealization

Usage

Component.providedInterface Component.requiredInterface

Component.requiredInterface.nameComponent.providedInterface.name

Component.providedInterface.operation

Page 23: Ontologies Reasoning Components Agents Simulations Architectural Modeling with UML2 Composite Structures and Components Jacques Robin

Component Diagram Nested Component Diagram Nested Classifiers Compartment: Link to Classifiers Compartment: Link to

Meta-ModelMeta-Model

Component

Component.name

NestedClassifiersCompartment

Component.nestedClassifier.ownedAttribute.isComposite = true

Component.nestedClassifier= Class

Component.nestedClassifier= Class

Component.nestedClassifier= Association

Component.nestedClassifier.name

Component.nestedClassifier.name

Component.nestedClassifier.ownedAttribute.upper= Component.nestedClassfier.ownedAttribute.lower

Component.providedInterface

Component.providedInterface.name

Component.requiredInterface.name

Component.requiredInterface

Component.nestedClassifier.ownedAttribute.name

Page 24: Ontologies Reasoning Components Agents Simulations Architectural Modeling with UML2 Composite Structures and Components Jacques Robin

Component Diagram Parts Component Diagram Parts Compartment: Link to Meta-ModelCompartment: Link to Meta-Model

Component.ownedPort

Component.ownedPort

PartsCompartment

Component.ownedConnector

Component.ownedConnector

Component.part.type = Component

Component.part.type = Component Component.part.type = Component

Component.part.type.name

Component.part.type.name Component.part.type.name

Component.ownedConnector.kind = #delegate

Component.ownedConnector.kind = #delegate

Component.ownedConnector.kind = #assembly

Component.ownedConnector.ConnectorEnd.type

Component.ownedConnector.ConnectorEnd.type

Component.name

Component

Component.providedInterface

Component.providedInterface.name

Component.requiredInterface

Component.requiredInterface.name