Architectural Modeling with UML 2 Composite Structures and

  • Slides: 24
Download presentation
Architectural Modeling with UML 2 Composite Structures and Components Jacques Robin Ontologies Reasoning Components

Architectural Modeling with UML 2 Composite Structures and Components Jacques Robin Ontologies Reasoning Components Agents Simulations

Outline E UML 2 Structured Classifiers E E Key Concepts Concrete Visual Syntax and

Outline E UML 2 Structured Classifiers E E Key Concepts Concrete Visual Syntax and Examples Meta-Model Link between Meta-Model and Visual Syntax E UML 2 Encapsulated Classifiers E E Key Concepts Concrete Visual Syntax and Examples Meta-Model Link between Meta-Model and Visual Syntax E UML 2 Components E Key Concepts E Concrete Visual Syntax and Examples EMeta-Model E Link between Meta-Model and Visual Syntax

UML 2 Structured Classifiers E New to UML 2 E A UML 2 structured

UML 2 Structured Classifiers E New to UML 2 E A UML 2 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 E 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 E Whereas a composition property of a kernel classes represents a contextindependent relationship from the kernel “whole” class to the “part” class, E the part property of a structured classifier represents a context-dependent relationship from a structured “whole” class to the “part” class E Similarly, the connection relationship between two parts of a containing structured classifier is distinct but derived from the association relationship between two classes E Whereas an association represents a context-independent relationships between two classes, E the connection between two classes that are parts of a containing structured classifier is valid only within the context of this container

UML 2 Structured Classifier Compartments Name Attributes Operations Nested. Classifi ers Parts Nested Classes,

UML 2 Structured Classifier Compartments Name Attributes Operations Nested. Classifi ers Parts Nested Classes, Components, Interfaces Associations linking their attributes, Realizations, Usages & Generalizations Encapsulated within containing Kernel: : C Classes, Components, Interfaces & Connectors linking them as parts or elements connected to parts in context of containing Composite. Structures: : Class

Composed Class x Structured Class Composition: context independent whole-part relationship Structured. Class/ Connector: Class.

Composed Class x Structured Class Composition: context independent whole-part relationship Structured. Class/ Connector: Class. Connected. To. Part: relationship Structured. Class/Part: dependent of context-dependent containing whole-part relationship. Structured. Class Parts Compartment Association: context independent relationship

Structured Class: Meta-Model 0. . 1 type Type Classifier Kernel: : Class Structured Classifier

Structured Class: Meta-Model 0. . 1 type Type Classifier Kernel: : Class Structured Classifier Feature Typed. Element Multiplicity. Element Structural Feature 0. . 1 attribute * Connectable. Element 0. . 1 owned. Attribute * role /defining. End Property 0. . 1 /part * 0. . 1 part. With. Port redfined. Connector Encapsulated Classifier Encapsulated. Classifiers: : Class 0. . 1 owned. Connector * Association * * 2. . * Connector type Connector. End * /role

Class x Composite Structure Diagrams: Link to Meta-Model K: : Class. owned. Attribute. is.

Class x Composite Structure Diagrams: Link to Meta-Model K: : Class. owned. Attribute. is. Composite = true CS: : Class. owned. Connector. End. role = Pr K: : Class. owned. Attribute. association = Association K: : Class. name CS: : Class. owned. Connector. End = Connector. End CS: : Class. part = Property CS: : Class. name CS: : Class K: : Class. name K: : Class. owned. Attribute. upper = K: : Class. owned. Attribute. lower K: : Class. owned. Attribute. association = Association K: : Class. owned. Attribute. association. name K: : Class. owned. Attribute. name CS: : Class. role. upper = CS: : Class. role. lower = Integer CS: : Class. owned. Connector. name CS: : Class. part. type = K: : Cla CS: : Class. owned. Connecto = Connector CS: : Class. owned. Connector. type. name CS: : Class. role = Property

Composite Structure Diagram: Classes

Composite Structure Diagram: Classes

Composite Structure Diagram: Objects Packageable. Element 0. . 1 Typed. Element Expression Structural. Feature

Composite Structure Diagram: Objects Packageable. Element 0. . 1 Typed. Element Expression Structural. Feature * Instance. Specification 0. . * Classifier Class * Slot Value. Specification 0. . 1 * 0. . 1 Literal. Unlimited. Natural Opaque. Expression Literal. Integer Literal. Specification Literal. String Instance. Value Literal. Boolean

Composite Structure Diagram: Objects Packageable. Element 0. . 1 Typed. Element Expression Named. Element

Composite Structure Diagram: Objects Packageable. Element 0. . 1 Typed. Element Expression Named. Element Instance. Specification 0. . * * Structural. Feature * Slot Value. Specification 0. . 1 * 0. . 1 Literal. Unlimited. Natural Opaque. Expression Literal. Integer Literal. Specification Literal. String Instance. Value Literal. Boolean Classifier Instance. Specification. classifier. parts. role. name Instance. Specification. classifier. name Class Instance. Specification. classifier. owned. Connector. name Instance. Specification. classifier. parts. name

UML 2 Encapsulated Class E New to UML 2 E Specializes Structured Classifier E

UML 2 Encapsulated Class E New to UML 2 E Specializes Structured Classifier E An instances of an encapsulated class (encapsulated object) interacts with its environment and its internal parts only through typed interaction points called ports E A port is an interaction point specification used by an encapsulated class to either: E Provide a service to its environment specified by a provided interface that types the port E Request a service from its environment specified by a requested interface that types the port E Ports provide a second level encapsulation indirection beyond the first one provided by interfaces: EEncapsulated parts are connected indirectly through their ports, E whereas simple parts are connected directly.

UML 2 Ports E Ports allow run-time assembly of encapsulated classes into a containing

UML 2 Ports E Ports allow run-time assembly of encapsulated classes into a containing class to compose a complex service from simpler ones E Instantiation of an encapsulated class with internal parts which are recursively encapsulated class is a complex process that involves: E Instantiating each nested encapsulated class E Instantiating each of their ports into an interaction point E Instantiating each of their associations into a connector between two such interaction points E 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 E This conformance can be: E Simple, merely in terms of matching interface types E More complex in terms of pre and post-condition constraints on each operation of the ports’ respective interfaces E Even more complex in terms of protocol state machines associated to either the ports or their interfaces E A protocol state machine describes a precise, constrained sequence of externally visible states through which the encapsulated class can go through E 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 E It also specifies the next state resulting from the invocation of a given operation in a given state

UML 2 Encapsulated Classifier Compartments Name Ports Attributes Operations Nested Classes, Generalizations, Ports, Associations

UML 2 Encapsulated Classifier Compartments Name Ports Attributes Operations Nested Classes, Generalizations, Ports, Associations linking their attributes, Encapsulated within containing Kernel: : Class Nested. Classifi ers Parts Classes, Connectors linking them through their Ports as parts or elements connected to in context of containing Composite. Structures

Encapsulated Class: Meta-Model 0. . 1 type Type Classifier Kernel: : Class Structured Classifier

Encapsulated Class: Meta-Model 0. . 1 type Type Classifier Kernel: : Class Structured Classifier Feature Typed. Element Multiplicity. Element Structural Feature 0. . 1 attribute * role Connectable. Element 0. . 1 owned. Attribute * /defining. End Property 0. . 1 part. With. Port 0. . 1 /part * redfined. Connector * * 0. . 1 owned. Connector * Connector 2. . * type redfined. Port * Encapsulated owned. Port Classifier 0. . 1 * Port Encapsulated. Classifiers: : Class /role State. Machine Connector. End * Association Relationship specific. Machinconforman 0. . 1 e ce Protocol. State. Machine Interface * Protocol. Conformance protocol * /provided * general. Machin e* * protocol * /required * 0. . 1

Composite Structure Diagram with Encapsulated Classes: Link to Meta-Model Class. owned. Connector. End. part.

Composite Structure Diagram with Encapsulated Classes: Link to Meta-Model Class. owned. Connector. End. part. With. Por Class. owned. Port. provided. Interface. name Class. owned. Connector. name Class. owned. Port. name Class. part Class. role Class. part. type = Class. owned. Connector. End. upper = Class. owned. Connector. Conn Class. owned. Port Class. name Class. owned. Port. required. Interface CS: : Class. owned. Port. type = CS: : Class. owned. Port. provided. Interface -> union(CS: : class. owned. Port. required. Interface) Class. owned. Connector Class. part Class. owned. Connector. End. part. With

Composite Structure Diagram with Encapsulated Classes: More Examples E Part multiplicity can also appear

Composite Structure Diagram with Encapsulated Classes: More Examples E Part multiplicity can also appear in the top right corner of the part rectangle E The type of a port can also appear after its name and “: ” E The multiplicity of a port can also appear after its name or type between “[ ]” E The service provided by an encapsulated class C by connecting to one of its port can be realized either: E By one (or several) part(s) of C E By C itself, in this case the port square is linked by a line to a state appearing inside C’s part compartment

UML 2 Components E New to UML 2 for all lifecycle stages except deployment

UML 2 Components E New to UML 2 for all lifecycle stages except deployment E Specialize encapsulated classes E The behaviors that it provides to its environment are only accessible through its provided interface(s) E The behaviors that it expects its environment to provide to it are only accessible through its required interface(s) E Through these associated interfaces, a UML 2 component defines an abstract behavioral type independent of its realization E The interfaces of a UML 2 component can be either: E Directly associated to it, or E Indirectly associated to it through its ports. E The abstract behavior type specified by a UML 2 component can be realized either: E Directly by the component itself; E Indirectly by the assembly of its internal parts; E Indirectly by a set of external classifiers. E A UML 2 packageable component specializes a UML 2 component by grouping all the artifacts involved in the component specification or realization into a package

UML 2 Components E A UML 2 component may: E Delegate part of the

UML 2 Components E A UML 2 component may: E Delegate part of the realization of a service that it provides to its environment to one of its internal parts; E Delegate a service request from one of its part to its environment. E Component connectors specialize encapsulated class connectors by: E Being associated to a behavior designed by contract E 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; E 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; E Sub-categorizing into: E Delegation connector between a containing component and its parts; E Assembly connector between two parts of an containing component

UML 2 Component Compartments <<component >> Name Attributes Operations Nested. Classifi ers Parts Ports

UML 2 Component Compartments <<component >> Name Attributes Operations Nested. Classifi ers Parts Ports Nested Classes, Components, Ports, Interfa & Associations linking their attributes, Realizations, Usages & Generalizations Encapsulated within containing Kernel: : Classes, Components, Interfaces & Connectors linking them through their Ports as parts or elements connected to parts in context of containing Composite. Structures: : Class

UML 2 Component: Meta-Model 0. . 1 owned. Connector * Structured Classifier CS: :

UML 2 Component: Meta-Model 0. . 1 owned. Connector * Structured Classifier CS: : Connector redfined. Port Encapsulated owned. Port Classifier 0. . 1 * Encapsulated. Classifiers: : Class * Port * /required * Interface * /provided * * * /required Component 0. . 1 /provided Components: : Connector <<enumeration>> Connector. Kind packaged. Element 0. . 1 /owned. Connectorkind: Connector. Kind * * * assembly * contract delegate Packageable. Element. Component. Realization * Behavior Realization

Component Diagram without Interface Operations: Link to Meta-Model Component. required. Interface. name Component. provided.

Component Diagram without Interface Operations: Link to Meta-Model Component. required. Interface. name Component. provided. Interface Component. required. Interfac Component. provided. Interface. name Component. provided. Interface Component. name Component. required. Interface

Component Diagram with Interface Operations: Link to Meta-Model Component. provided. Interface Component. required. Interface

Component Diagram with Interface Operations: Link to Meta-Model Component. provided. Interface Component. required. Interface Realization Component Usage Component. provided. Interface. name Component. provided. Interface. operation Component. required. Interface. na

Component Diagram Nested Classifiers Compartment: Link to Meta-Model Component. nested. Classifier. owned. Attribute. upper

Component Diagram Nested Classifiers Compartment: Link to Meta-Model Component. nested. Classifier. owned. Attribute. upper = Component. nested. Classfier. owned. Attribute. lower Component. name Component. provided. Interface Component. nested. Classifier = Class Component. nested. Classifier. owned. Attribute. is. Composite = true Component. nested. Classifier. owned. Attribute. name Nested. Classifiers. Compartment Component. nested. Classifier. name Component. required. Interface Component. nested. Classifier = Association Component. required. Interface. Component. name nested. Classifier. name Component. nested. Classifier = Class

Component Diagram Parts Compartment: Link to Meta-Model Component. owned. Connector. End. type Component. owned.

Component Diagram Parts Compartment: Link to Meta-Model Component. owned. Connector. End. type Component. owned. Connector owned. Port Component. owned. Connector. kind = #delegate Component. provided. Interface. name Component. part. type = Component. part. type. name Component. provided. Interface Component. owned. Connector. End. type Component. owned. Connector. kind = #assembly Component owned. Port Component. owned. Connector. kind = #delegate Component. part. type. name Component. part. type = Component Parts. Compartment Component. required. Interface. name Component. required. Interfac