Presentation is loading. Please wait.

Presentation is loading. Please wait.

Ontologies Reasoning Components Agents Simulations Architectural Modeling with UML2 Composite Structures and Components Jacques Robin.

Similar presentations


Presentation on theme: "Ontologies Reasoning Components Agents Simulations Architectural Modeling with UML2 Composite Structures and Components Jacques Robin."— Presentation transcript:

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

2 Outline  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

3 UML2 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

4 Name Attributes Operations NestedClassifiers Parts UML2 Structured Classifier Compartments Nested Classes, Components, Interfaces & Associations linking their attributes, Realizations, Usages & Generalizations Encapsulated within containing Kernel::Class Classes, Components, Interfaces & Connectors linking them as parts or elements connected to parts in context of containing CompositeStructures::Class

5 Composed Class x Structured Class Composition: context independent whole-part relationship Association: context independent relationship StructuredClass/Part: context-dependent whole-part relationship Connector: relationship dependent of containing StructuredClass StructuredClass/ ClassConnectedToPart: relationship dependent of containing StructuredClass Parts Compartment

6 * Structured Class: Meta-Model Structured Classifier Classifier ConnectableElement TypedElement Structural Feature Property Connector 0..1 ownedAttribute * 0..1 /part * 0..1 ownedConnector * ConnectorEnd role /definingEnd Association type 0..1 attribute * 0..1 partWithPort redfinedConnector * 2..* * Type Kernel::Class 0..1 type /role MultiplicityElementFeature Encapsulated Classifier EncapsulatedClassifiers:: Class

7 Class x Composite Structure Diagrams: Link to Meta-Model CS::Class.name CS::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 = Connector CS::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.name K::Class.ownedAttribute.upper = K::Class.ownedAttribute.lower K::Class.name K::Class.ownedAttribute.name

8 Composite Structure Diagram: Classes

9 Composite Structure Diagram: Objects InstanceSpecification PackageableElementElement Slot ValueSpecification Classifier StructuralFeature LiteralSpecification InstanceValue OpaqueExpression LiteralBoolean LiteralInteger LiteralString LiteralUnlimitedNaturalExpression 0..1 * * 0..* * 0..1 TypedElement Class

10 Composite Structure Diagram: Objects InstanceSpecification PackageableElementElement Slot ValueSpecification Classifier StructuralFeature LiteralSpecification InstanceValue OpaqueExpression LiteralBoolean LiteralInteger LiteralString LiteralUnlimitedNaturalExpression 0..1 * * 0..* * 0..1 TypedElement Class NamedElement InstanceSpecification.classifier.ownedConnector.name InstanceSpecification.classifier.name InstanceSpecification.classifier.parts.role.name InstanceSpecification.classifier.parts.name

11 UML2 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.

12 UML2 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

13 Name Attributes Operations NestedClassifiers Parts UML2 Encapsulated Classifier Compartments Classes, Connectors linking them through their Ports as parts or elements connected to parts in context of containing CompositeStructures::Class Nested Classes, Generalizations, Ports, Associations linking their attributes, Encapsulated within containing Kernel::Class Ports

14 * Encapsulated Class: Meta-Model Structured Classifier Classifier ConnectableElement TypedElement Structural Feature Property Connector 0..1 ownedAttribute * 0..1 /part * 0..1 ownedConnector * ConnectorEnd role /definingEnd Association type 0..1 attribute * 0..1 partWithPort redfinedConnector * 2..* * Type Kernel::Class 0..1 type /role MultiplicityElementFeature Encapsulated Classifier EncapsulatedClassifiers:: Class Port ownedPort Interface * /required * * /provided * redfinedPort ProtocolStateMachine protocol * protocol 0..1 StateMachine ProtocolConformance 0..1 Relationship * * 0..1 conformance specificMachine generalMachine * *

15 Composite Structure Diagram with Encapsulated 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.ownedPort.providedInterface Class.ownedPort.requiredInterface Class.ownedPort.requiredInterface.name Class.ownedPort.providedInterface.name Class.ownedPort Class.ownedPort.name 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

16 Composite Structure Diagram with Encapsulated Classes: More Examples  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

17 UML2 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

18 UML2 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

19 > Name Attributes Operations NestedClassifiers Parts UML2 Component Compartments Classes, Components, Interfaces & Connectors linking them through their Ports as parts or elements connected to parts in context of containing CompositeStructures::Class Nested Classes, Components, Ports, Interfaces & Associations linking their attributes, Realizations, Usages & Generalizations Encapsulated within containing Kernel::Class Ports

20 UML2 Component: Meta-Model Encapsulated Classifier EncapsulatedClassifiers:: Class Port ownedPort Interface * /required * * /provided * redfinedPort * * 0..1 Component /required /provided * * Structured Classifier CS::Connector 0..1 ownedConnector * Components::Connector kind:ConnectorKind > ConnectorKind assembly delegate 0..1 /ownedConnector * Behavior contract * * ComponentRealization Realization 0..1 * PackageableElement 0..1 * packagedElement

21 Component Diagram without Interface Operations: Link to Meta-Model Component Component.name Component.providedInterface Component.providedInterface.name Component.requiredInterface Component.requiredInterface.name

22 Component Diagram with Interface Operations: Link to Meta-Model Component Component.name Interface Realization Usage Component.providedInterfaceComponent.requiredInterface Component.requiredInterface.name Component.providedInterface.name Component.providedInterface.operation

23 Component Diagram Nested Classifiers Compartment: Link to Meta-Model Component Component.name NestedClassifiersCompartment Component. nestedClassifier. ownedAttribute. isComposite = true 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

24 Component Diagram Parts Compartment: Link to Meta-Model Component. ownedPort Component. ownedPort PartsCompartment Component.ownedConnector Component.part.type = Component Component.part.type.name 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


Download ppt "Ontologies Reasoning Components Agents Simulations Architectural Modeling with UML2 Composite Structures and Components Jacques Robin."

Similar presentations


Ads by Google