The Kobr A 2 MultiView Component Model Driven
The Kobr. A 2 Multi-View Component Model Driven Software Engineering Methodology Jacques Robin Ontologies Reasoning Components Agents Simulations
Outline 1. 2. 3. 4. 5. 6. History Kobr. A Goals and Principles Component Views Component Relationships Process Illustrative Case Studies 1. KWAPIF: a Kobr. A 2 Web App Platform-Independent Framework 2. A toy photo album web app, instance of KWAPIF 3. KMASPIF: a Kobr. A 2 Multi-Agent System Platform-Independent Framework 4. A toy penalty simulation MAS, instance of KMASPIF
Kobr. A: History E Kobr. A 1 E German project lead by Prof. Colin Atkinson at Fh. G-IESE (Fraunhofer. Gesellschaft, Institute of Experimental Software Engineering), Kaiserslautern, Germany E Resulted in publication of book "Component-Based Product Line Engineering with UML", Atkinson, C. and al. , 2002, Addison-Wesley, 528 pages E Extended for component testing by European project Component+ involving 7 European academic and industrial research centers E Resulted in publication of book "Component-Based Software Testing with UML", Gross, H. B. , 2004, Springer, 316 pages E Based on UML 1. 4, no OCL, no MOF
Kobr. A: History E Kobr. A 2: E Brazilian-German project started in 2006, led by Profs. Colin Atkinson, Universität Mannheim, and Jacques Robin, UFPE E Goals: E Leverage lastest OMG standards: UML 2, OCL 2, MOF 2 E Support most mature levels of MDE allowing full code generation by model transformation from fully refined Platform-Independent Models (PIMs) E Support full separation of concerns into complementary views of software component PIMs
Kobr. A 1 Goals Component-Based Engineering (CBE) 3 1 Product-Line Engineering (PLE) Kobr. A 2 Model-Driven Engineering (MDE)
Kobr. A Principles: 1. Separation of Concerns E Separate functionalities of whole software concerns into reusable components E For each component: E Separate PIM from PSM from code E Separate general product line framework model from specific product application model E Separate execution model from testing model E Separate public specification from private, encapsulated realization E Separate structural model from behavioral model from operational models (operations link behavior to structure) E Separate computational service aspects from data structure aspects E Separate concept (class) model from instance (object) model E Separate software methodology into: E prescribed or recommended artifacts, and E prescribed or recommended process (i. e. , constraints on tasks producing these artifacts, including precedence)
Separation of Concerns E Process does not fix whether to move first left, front or down in this cube Executability Framework Engineering Instantiation Application Implementation Specificity Implementation Refinement/Nesting
Kobr. A Principles 2. Multiple views: E For each component, provide one view for each point in the multi-dimensional space of separated concerns E For each component, reconcile these views into a Single Unified Model (SUM) 3. Leverage OMG standards: E UML 2 diagrams and OCL 2 constraints and expressions for framework and application PIMs E MOF 2 diagrams and OCL 2 constraints to metamodel these framework and application level diagrams and associated constraints E UML 2 diagrams and OCL 2 constraints for software process modeling 4. Prescriptiveness E Kobr. A strives to precisely prescribe, as much as possible for a general purpose software engineering methodology, which UML 2 and OCL 2 model elements to use in each view of a Kobr. A component
Kobr. A Principles E User only create and manipulate partial views of each Kobr. A component E These views are automatically transformed into a coherent Single Unified Model by model transformations Partial View 1 to SUM automated transformation SUM to View 1 automated transformation . . . Partial View 2 Partial View N Single View 2 to SUM automated transformation Unified SUM to View 2 automated transformation Model View N to SUM automated transformation SUM to View N automated transformation Metamodel conformance verification automated transformation
Kobr. A Principles 5. Formally specified rules to automatically check: E View-level well-formedness (i. e. , conformance to prescribed relationships among model elements within one view of one component) E Component-level well-formedness (i. e. , conformance to prescribed relationships among model elements across different views of one component) E Assembly-level well-formedness (i. e. , conformance to prescribed relationships among model elements across views of different components) 6. Parsimony E Avoid as much as possible redundant model elements and views E Choose a minimum model element and diagram subsets from UML 2, able to cover all the key aspects/concerns of a software component
Kobr. A Principles 7. Locality E E All Kobr. A Views and UML 2 diagrams are local to a given component stereotyped as the «subject» component of the view, and hence reusable "as is"; The whole PIM of the system is derivable from the union of all these local models 8. Uniformity E The sole first-class modeling entity deserving to possess its own multiple views is the Kobr. A component E All behaviorally complex entities are modeled as Kobr. A components, including the system itself E Only behaviorally trivial system entities are modeled as Kobr. A classes, second-class modeling entity which structure and behavior are specified and realized in the views of their owning Kobr. A component
Kobr. A Principles 9. Top-down decomposition E The realization of any Kobr. A component K potentially consist of an assembly of finer-grained Kobr. A components, encapsulated in K and not directly visible outside of K E There is thus no fundamental difference between assembling existing components (i. e. , engineering with reuse) and refining new components (i. e. , engineering for reuse); E The root of this decomposition is the system being modeled; E Its leaves are the common functionalities provided by the most popular or standard API for the application domain at hand. 10. Component engineering/assembly driven process: E Thus, driven by architecture, E E neither strictly by entities (like pure OO) nor by relationships (like E-R DB engineering), nor by functionalities (like use-case driven engineering); Hence, avoids RUP inherent conflict between being entitiy-driven (objects) and functionality-driven (use-case).
Kobr. A Principles E Separate public specification from encapsulated realization External view point Internal view point Component Specification Realization E Realization as local assembly of finer-grained components E Component engineering (for reuse) = component assembly (with reuse) + =
Kobr. A Principles: Locality and Top-Down Decomposition Run-time Hierarchy Development Time Description Traditional approaches “component of” relationship defines set of models Kobr. A (Principle of Locality)
Kobr. A Conformance Rules Consistency relationships A Contract relationship Refinement relationships B
Kobr. A Conformance Rules E Specification of server component must match realization of client component Clientship + Containment rules Clientship rules Cliensthip rules Clientship + Containment rules Clientship rules
Kobr. A Principle: Creation Tree Driven Process E In general, the client/server model leads to arbitrary graph of interconnected components E But, an arbitrary graph has numerous shortcomings as software structure: E Neither model of composition/nesting, nor obvious development order E Tree based software structure has many advantages: E E E Natural model of composition/nested Obvious development sequences Recursive definitions and activities Systematic All together resulting in improved quality and reusability E How to reconcile arbitrary client server graph with tree-based process? E Solution: by projecting graph on creation tree E Every software entity must be created by exactly one other entity E Every object-oriented system running today contains a creation tree E An entity normally creates the things to which it has a strong composition relationship
Kobr. A Component Assembly E Client-Server Graph Projected on Creation Tree A B acquires C D E F H I 1 G creates I 2
Kobr. A 2 Views
Kobr. A 2 Component Views Specification «merge» Structural Class Service Class Type Instance Service Behavioral Protocol Service Type Instance Type Operational Service Realization Service Type Operational Type Service Behavioral Algorithmic Type
Kobr. A 2 Global Views: Operational Dependencies E Automatically derived from the Operational and Algorithmic Views local to each component E Operation O 1 depends on operation O 2 iff: E O 2 is called in the OCL 2 expression specifying the precondition, body or post-condition of O 1 (operational view) E O 2 is called in the Activity Diagram A specifying the method of O 1 (algorithmic view) E O 2 is called in the OCL 2 expression specifying a guard or a local postcondition in the Activity Diagram A specifying the method of O 1 (algorithmic view)
Kobr. A 2 Global Views: Component Class Dependencies E Automatically derived from the global operation dependency view and the local structural class views at each component E Component Class or (Data) Class C 1 depends on Component Class or (Data) Class C 2 iff: E E O 1 operation C 1, O 2 operation C 2 | O 1 depends on O 2, or C 2 appears in the structural class service or type view of C 1, or A associating C 1 with C 2, or C 1 specializes C 2
Specification Structural Class Service View: Overview E Specifies the local assembly connections of the subject component class E Shows: EThe name, public operation signatures and public attributes of: E E subject component S 0 the component or (data) classes G 1, . . . , Gm that immediately generalize S 0 the components S 1, . . . , Sn providing S 0's required services the components C 1, . . . , Cp that S 0's creates before using as server EGeneralization relationships from S 0 to G 1, . . . , Gm EStereotypes associations «acquires» from S 0 to S 1, . . . , Sn EStereotypes associations «creates» from S 0 to C 1, . . . , Cp EStructural OCL constraints, i. e. , classifier invariants and property initialization, derivation and definitions, among the attributes or operation parameters of S 0, G 1, . . . Gm, S 1, . . . , Sn, C 1, . . . , Cp
Prototypical Specification Structural Class Service View
Specification Structural Class Type View: Reused UML 2/OCL 2 Metamodel Element * constrained. Element * Constraint 0. . 1 owning. Constraint owned. Rule * Named. Element Namespace Typed. Element 0. . 1 context general * Generalization Classifier specific * 0. . 1 power. Type Variable specification Value. Specification Whole OCL 2 Metamodel Opaque. Expression top. Expression 0. . 1 Ocl. Expression body. Expression 0. . 1 context. Variable self. Owner In. Ocl 0. . 1 * * Generalization. Set power. Extent * Data. Type Structured Classifier Encapsulated. Classifier Behaviored Classifier Component 0. . 1 Enumeration Literal Instance Specification /super. Class * Class (from Structured. Class) Class (from Reception) Enumeration Primitive. Type * Class (from Kernel) 0. . 1 owned. Attribute * member. End Property Association 2. . * 0. . 1 Operation Parameter 0. . 1 owned. Operation * 0. . 1 owned. Parameter *
Specification Structural Class Service View: Metamodel Kobr. A 2 Extension Association Class (from Reception) (from Kernel) Component Constraint Property constrained. Element Acquires Creates Component. Class context Structural Constraint owned. Rule constrained. Element Init Inv Classifier (from Kernel) Data. Type Primitive. Type Data. Type String Primitive. Type Numeric Integer Boolean Real Unlimited. Natural Derived Prop. Def
Specification Structural Class Type View: Overview E Defines the non-primitive data types used by the subject component class E Shows: E The name, public operations signatures and public attributes of the (data) classes and association classes that type the parameters of the public operations of the components or (data) classes that appear in the Specification Structural Class Service View of the subject component class E The generalizations and associations (including association classes, aggregations and compositions) among these (data) classes and association classes E The structural OCL constraints among the properties and operation parameters of these classes and association classes E The definition of the enumerations that type the parameters of the public operations of the component or (data) classes that appear in the Specification Structural Class Service View of the subject component class
Prototypical Specification Structural Class Type View
Specification Structural Class Type View: Reused UML 2/OCL 2 Metamodel Element * constrained. Element * Constraint 0. . 1 owning. Constraint owned. Rule * Named. Element Namespace Typed. Element 0. . 1 context general * Generalization Classifier specific * 0. . 1 power. Type Variable specification Value. Specification Whole OCL 2 Metamodel Opaque. Expression top. Expression 0. . 1 Ocl. Expression body. Expression 0. . 1 context. Variable self. Owner In. Ocl 0. . 1 * * Generalization. Set power. Extent * Data. Type Structured Classifier Encapsulated. Classifier Behaviored Classifier /super. Class * Class (from Structured. Class) Component Class (from Reception) Enumeration * Class (from Kernel) Primitive. Type 0. . 1 Enumeration Literal Instance Specification Association. Class 0. . 1 owned. Attribute * member. End Property Association 2. . * 0. . 1 Operation Parameter 0. . 1 owned. Operation * 0. . 1 owned. Parameter *
Specification Structural Class Type View: Metamodel Kobr. A 2 Extension Class (from Reception) (from Kernel) Component Constraint Property constrained. Element Component. Class context Structural Constraint owned. Rule constrained. Element Init Inv Classifier (from Kernel) Data. Type Primitive. Type Data. Type String Primitive. Type Numeric Integer Boolean Real Unlimited. Natural Derived Prop. Def
Specification Structural Instance Service View: Overview E Defines typical instantiation patterns of the Specification Structural Class Service View of the subject component class E Shows: E «Component. Object» stereotyped component object(s) O 01, . . . , O 0 q 1 instance(s) of subject component class S 0 with their public slots E «Component. Object» stereotyped component objects(s) S 11, . . . , Snqn instances(s) of component classes S 1, . . . , Sn providing the services requires by S 0, with their public slots E «acquires» stereotyped links La 11, . . . , Lanqn instances of the «acquires» stereotyped associations between S 0 and S 1, . . . , Sn E «Component. Object» stereotyped component objects(s) S 11, . . . , Snqn instances(s) of component classes C 1, . . . , Cp created by S 0 1 qp E «creates» stereotyped links Lc 1 , . . . , Lcp instances of the «acquires» stereotyped associations between S 0 and C 1, . . . , Cp
Prototypical Specification Structural Instance Service View
Specification Structural Instance Service View: Reused UML 2/OCL 2 Metamodel Named. Element Packageable. Element Instance Specification owning. Instance* Slot * 0. . 1 owning. Slot defining. Feature Property * Classifier (from Kernel) Opaque. Expression Structural. Feature * featuring Classifier Feature Value value * Specification Variable 0. . 1 context. Variable Typed. Element top. Expression 0. . 1 self. Owner Expression 0. . 1 In. Ocl. Expression body. Expression
Specification Structural Instance Service View: Metamodel Kobr. A 2 Extension Instance. Specification Link Acquires. Link Creates. Link Object Component. Object
Specification Structural Instance Type View: Overview E Defines typical instantiation patterns of the Specification Structural Class Type View, of the subject component class E Shows: E «Component. Object» stereotyped instance specifications whose classifying classifier are the component classes occurring in the Specification Structural Class Type View of the subject component class E Instance specifications whose classifier are the (data) classes occurring in the Specification Structural Class Type View of the subject component class E Instance specifications whose classifier are the associations (not classes) occurring in the Specification Structural Class Type View of the subject component class
Prototypical Specification Structural Instance Type View
Specification Structural Instance Type View: Reused UML 2/OCL 2 Metamodel Named. Element Same as Specification Structural Instance Service View Element Packageable. Element Instance Specification owning. Instance* Slot * 0. . 1 owning. Slot defining. Feature Property Opaque. Expression Structural. Feature 0. . 1 context. Variable * Classifier (from Kernel) * featuring Classifier Feature Variable self. Owner 0. . 1 top. Expression 0. . 1 result. Variable result. Owner Expression 0. . 1 In. Ocl * parameter. Variable var. Owner 0. . 1 Typed. Element correct Value value * Specification Ocl. Expression body. Expression
Specification Structural Instance Type View: Metamodel Kobr. A 2 Extension Instance. Specification Link Object. Link Component. Object
Specification Operational Service View: Overview E Declaratively specifies the behavioral contracts between the component classes of the Specification Structural Class Service View of the subject component class E Shows: E The OCL precondition, postcondition or body constraints of the operations whose signatures are given in the Specification Structural Class Service View of the subject component class
Prototypical Specification Operational Service View E context CC 0: : op 01(in pa 011: Cl 2, inout p 012: Boolean, out p 013: Real): Cla pre: qboe 011 body: qoe 011 E context CC 0: : op 02(pa 021: Set(Integer)): Ordered. Set(Tuple(Integer, Strin g)) pre: qboe 021 post: pboe 021 E context CC 1: : op 11(pa 111: Bag(Cla)): Sequence(String) pre: qboe 111 E context CC 1: : op 12(): CC 2 body: qoe 121 E context CC 2: : op 21(): Clb post: pboe 211 E context Cla: : opa 1(in paa 11: Cl 2, inout paa 12: Boolean, out paa 13: Real): Clb pre: qboea 11 body: qoea 11 E context Cla: : opa 2(paa 21: Set(Integer)): Ordered. Set(Tuple(Integer, String ) E context Clb: : opb 2(): CC 1 post: qboeb 21 E context Clc: : opc 1(): Cla post: qboec 11 E Conventions: E q: OCL query expression E p: OCL postcondition expression E b: OCL boolean expression E oe: Ocl Expression E CC: Component Class E Cl: Class E op: Operation E pa: parameter
Specification Operational Service View: Reused UML 2/OCL 2 Metamodel Namespace 0. . 1 context Behavioral. Feature Named. Element owned. Rule * 0. . 1 pre. Context precondition * Class (from Kernel) 0. . 1 Operation 0. . 1 post. Context postcondition * Constraint 0. . 1 body. Context bodycondition * * owned. Operation Element * constrained. Element 0. . 1 context. Variable 0. . 1 result. Variable * parameter. Variable Typed. Element Whole OCL 2 Metamodel body. Expression Ocl. Expression * owning. Constraint specification 0. . 1 Value. Specification Opaque. Expression self. Owner 0. . 1 result. Owner 0. . 1 var. Owner 0. . 1 Expression In. Ocl top. Expression 0. . 1
Specification Operational Service View: Metamodel Kobr. A 2 Extension Operation Constraint Effect. Operation Behavioral. Constraint Pre Post Ocl. Expression Post. Exp Pre. Exp
Specification Operational Type View: Overview E Declaratively specifies the behavioral contracts between the component classes, (data) classes and association classes of the Specification Structural Type View of the subject component class E Shows: E The OCL precondition, postcondition or bodies constraints of the operations whose signatures are given in the Specification Structural Type View of the subject component class
Prototypical Specification Operational Type View Econtext Cla: : opa 1(in paa 11: Cl 2, inout paa 12: Boolean, out Econtext ACB: : op. B 2(): CC 1 paa 13: Real): Clb post: qboe. B 21 pre: qboea 11 Econtext ACC: : op. C 1(): Cla body: qoea 11 post: qboe. C 11 Econtext Cla: : opa 2(paa 21: Set(Integer)): Ordered. Set(Tuple(String, Integer) pre: qboea 21 post: pboea 21 Econtext Clb: : opb 1(pab 11: Bag(ACa)): Sequence(String) pre: qboeb 11 Econtext Clb: : opb 2(): CC 1 post: qboeb 21 Econtext Clc: : opc 1(): ACa post: qboec 11 Econtext ACA: : op. A 1(in pa. A 11: Cl 2, inout pa. A 12: Boolean, out pa. A 13: Real): Clb pre: qboe. A 11 body: qoe. A 11 Econtext ACA: : op. A 2(pa. A 21: Set(Integer)): Ordered. Set(Tuple(Integer, Strin g)) pre: qboe. A 21
Specification Operational Type View: Reused UML 2/OCL 2 Metamodel Namespace Same as Specification Operational Service View 0. . 1 context Behavioral. Feature Named. Element owned. Rule * 0. . 1 pre. Context precondition * Class (from Kernel) 0. . 1 Operation 0. . 1 post. Context postcondition * Constraint 0. . 1 body. Context bodycondition * * owned. Operation Element * constrained. Element 0. . 1 context. Variable 0. . 1 result. Variable * parameter. Variable Typed. Element Whole OCL 2 Metamodel body. Expression Ocl. Expression * owning. Constraint specification 0. . 1 Value. Specification Opaque. Expression self. Owner 0. . 1 result. Owner 0. . 1 var. Owner 0. . 1 Expression In. Ocl top. Expression 0. . 1
Specification Operational Type View: Metamodel Kobr. A 2 Extension Operation Constraint Effect. Operation Behavioral. Constraint Pre Post Ocl. Expression Post. Exp Pre. Exp Same as Specification Operational Service View
Specification Behavioral Protocol View: Overview E Defines the external visible state transitions of the subject component class together with the restricted subset of its public operation that is available for invocation in each of these states E Contains a simple UML 2 protocol state machine without: E transition's operation post-conditions, for these are redundant with the transition's target state invariant E associated port or interface, for protocol state machines are directly associated with components in Kobr. A 2 E states with embedded state machines E multiple regions E connection points E The sequence of operations on the state machine transitions represent the protocol to follow to satisfy the invocation contract of the services provided by the subject component class
Prototypical Specification Behavioral Protocol View psm 1 {protocol} [qbs 0] op 0() / S 0 [qbe 0] [qb 01] op 01(pa 011: (Real, Boolean)) / qbe 12] op 12 (in pa 121: Integer inout pa 122: en 122, out pa 123: Seq(String) / [qbe 22] op 22(pa 221: CC 2) / S 2 [qbe 2] [qbe 2 f] op 2 f(pa 2 f 1: Cl 1) / ebe 2 f S 1 [qbe 1 ] [qbe 32] op 3() / [qbe 13] op 13() / S 3 [qb 3] [qbe 31] op 3() / [qbe 3 f] op 3() / ebe 3 f
Specification Behavioral Protocol View: Reused UML 2/OCL 2 Metamodel sourc e Vertex target * 0. . 1 outgoing Region incoming 0. . 1 Pseudo. State kind: Pseudo. State. Kind Transition State. Machine Protocol. Transition Protocol State Machine Final. State 0. . 1 owning. State «enumeration» Pseudo. State. Kind Namespace 0. . 1 context referred * Operation precondition guard 0. . 1 owned. Rule Constraint specification 0. . 1 owning. Constraint Value. Specification state. Invariant 0. . 1 initial. . . terminate Opaque. Expression Ocl. Expression body. Expressiontop. Expression. In. Ocl
Specification Behavioral Protocol View: Metamodel Kobr. A 2 Extension Behaviored classifier. Behavior Classifier 0. . 1 Class (from Reception) State. Machine Protocol. State. Machine Component. Class Protocol. State. Machine Region Protocol Transition Pseudo State Operation
Realization Structural Class Service View: Overview E Defines the internal component assembly that realize the services described in the Specification Structural Class Service View of the subject component E Shows: E The private attributes and operation signatures of subject component class S 0 E The name, public attributes and operation signatures of the component classes and (data) classes N 1, . . . , Nm nested inside (i. e. , encapsulated) the subject component which assembly realize its public operations specified in the Specification Structural Class Service View E The stereotyped «nests» associations from S 0 to N 1, . . . , Nm E The stereotyped «acquires» and «creates» associations among N 1, . . . , Nm E «acquires» associations model clientship relationships between one nested component class and one nested (data) class or another nested component class E «creates» associations model creation relationships between one nested component class and one nested (data) class or another nested component class E The generalizations among N 1, . . . , Nm E The structural OCL constraints (i. e. , classifier invariants as well as the derivation rules, initial values and definitions of classifier properties)
Prototypical Realization Structural Class Service View «nests»
Realization Structural Class Type View: Reused UML 2/OCL 2 Metamodel Element * constrained. Element * Constraint 0. . 1 owning. Constraint owned. Rule * Named. Element Namespace Whole OCL 2 Metamodel Typed. Element 0. . 1 context general * Generalization Classifier specific * 0. . 1 power. Type Variable * Data. Type Structured Classifier Behaviored Classifier Encapsulated. Classifier Component Class (from Reception) Enumeration var. Owner 0. . 1 Primitive. Type 0. . 1 Enumeration Literal Instance Specification /super. Class * Class (from Structured. Class) Opaque. Expression top. Expression 0. . 1 Ocl. Expression body. Expression 0. . 1 context. Variable self. Owner 0. . 1 Expression In. Ocl 0. . 1 result. Variable result. Owner 0. . 1 * parameter. Variable * Generalization. Set power. Extent * specification Value. Specification * Class (from Kernel) 0. . 1 owned. Attribute * member. End Property Association 2. . * 0. . 1 Operation Parameter 0. . 1 owned. Operation * 0. . 1 owned. Parameter * packaged. Element Packageable. Element 0. . 1 *
Realization Structural Class Service View: Metamodel Kobr. A 2 Extension Association Acquires Class (from Reception) (from Kernel) Component Creates Component. Class Nests owned context Rule Structural Constraint constrained Element Classifier (from Kernel) Data. Type Primitive. Type Constraint Data. Type String Primitive. Type Numeric Integer Boolean Real Unlimited. Natural Property constrained. Element Derived Init Inv Prop. Def
Realization Structural Class Type View: Overview E Is the Realization Structural Class Service View what the Specification Structural Class Type View is to the Specification Structural Class Service View E Defines the non-primitive data types used by either: E the private operations of subject component class E the internal assembly of the subject component class E but not used neither by its public operation nor by its external server components
Realization Structural Class Type View: Overview E Shows: E The name, public operations signatures and public attributes of the (data) classes and association classes that type the parameters of: E the private operations of the subject component class E the public operations of the component or (data) classes that appear in the Realization Structural Class Service View of the subject component class E The generalizations and associations (including association classes, aggregations and compositions) among these (data) classes and association classes E The structural OCL constraints among the properties and operation parameters of these (data) classes and association classes E The definition of the enumerations that type the parameters of: E the private operations of the subject component class E the public operations of the component or (data) classes that appear in the Realization Structural Class Service View of the subject component class
Prototypical Realization Structural Class Type View
Realization Structural Class Type View: Reused UML 2/OCL 2 Metamodel Element * constrained. Element * Constraint 0. . 1 owning. Constraint owned. Rule * Named. Element Namespace Whole OCL 2 Metamodel Typed. Element 0. . 1 context general * Generalization Classifier specific * 0. . 1 power. Type Variable * Data. Type Structured Classifier Behaviored Classifier Encapsulated. Classifier Class (from Structured. Class) Component Class (from Reception) Enumeration /super. Class * * Class (from Kernel) Opaque. Expression top. Expression 0. . 1 Ocl. Expression body. Expression 0. . 1 context. Variable self. Owner 0. . 1 Expression In. Ocl 0. . 1 result. Variable result. Owner 0. . 1 * parameter. Variable * Generalization. Set power. Extent * specification Value. Specification var. Owner 0. . 1 Primitive. Type 0. . 1 Enumeration Literal Instance Specification Association. Class 0. . 1 owned. Attribute * member. End Property Association 2. . * 0. . 1 Operation Parameter 0. . 1 owned. Operation * 0. . 1 owned. Parameter * packaged. Element Packageable. Element 0. . 1 *
Realization Structural Class Type View: Metamodel Kobr. A 2 Extension Same as Specification Structural Class Type View Class (from Reception) (from Kernel) Component Constraint constrained. Element Component. Class context Structural Constraint owned. Rule constrained. Element Classifier (from Kernel) Primitive. Type Data. Type String Primitive. Type Numeric Integer Boolean Real Unlimited. Natural Derived Init Inv Data. Type Property Prop. Def
Realization Structural Instance Service View: Overview E Defines typical instantiation patterns of the Realization Structural Class Service View of the subject component class E Shows: E «Component. Object» stereotyped component object(s) O 01, . . . , O 0 p (with their private slots) instance(s) of subject component class S 0 E «Component. Object» stereotyped component objects(s) NO 11, . . . , NOqr instances(s) of component classes N 1, . . . , Nm (with their public slots) nested inside S 0 and which assembly realizes the services provided by S 0 E «nests» stereotyped links Ln 11, . . . , Lnst instances of the «nests» stereotyped associations from S 0 to N 1, . . . , Nm E «acquires» stereotyped links La 11, . . . , Lauv instances of the «acquires» stereotyped associations among N 1, . . . , Nm E «creates» stereotyped links Lc 11, . . . , Lcwx instances of the «creates» stereotyped associations between S 0 and C 1, . . . , Cp
Prototypical Realization Structural Instance Service View «creates»
Realization Structural Instance Service View: Reused UML 2/OCL 2 Metamodel Named. Element Same as Specification Structural Instance Service View Element Packageable. Element Instance Specification owning. Instance* Slot * 0. . 1 owning. Slot defining. Feature Property Opaque. Expression Structural. Feature 0. . 1 context. Variable * Classifier (from Kernel) Value value * Specification * featuring Classifier Feature Variable self. Owner 0. . 1 top. Expression 0. . 1 result. Variable result. Owner Expression 0. . 1 In. Ocl * parameter. Variable var. Owner 0. . 1 Typed. Element Ocl. Expression body. Expression
Realization Structural Instance Service View: Metamodel Kobr. A 2 Extension Instance. Specification Link Acquires. Link Nests. Link Creates. Link Object Component. Object
Realization Structural Instance Type View: Overview E Defines typical instantiation patterns of the Realizatioon Structural Class Type View, of the subject component class E Shows: E «Component. Object» stereotyped instance specifications whose classifier are the component classes occurring in the Realization Structural Class Type View of the subject component class E Instance specifications whose classifier are the (data) classes occurring in the Realization Structural Class Type View of the subject component class E Instance specifications whose classifier are the associations (not classes) occurring in the Realization Structural Class Type View of the subject component class
Prototypical Realization Structural Instance Type View
Realization Structural Instance Type View: Reused UML 2/OCL 2 Metamodel Named. Element Same as Specification Structural Instance Service View Element Packageable. Element owning. Instance* Instance Specification Slot * 0. . 1 owning. Slot defining. Feature Property Opaque. Expression Structural. Feature 0. . 1 context. Variable Classifier (from Kernel) * Value value * Specification * featuring Classifier Feature Variable self. Owner 0. . 1 top. Expression 0. . 1 result. Variable result. Owner Expression 0. . 1 In. Ocl * parameter. Variable var. Owner 0. . 1 Typed. Element Ocl. Expression body. Expression
Realization Structural Instance Type View: Metamodel Kobr. A 2 Extension Instance. Specification Link Object Component. Object
Realization Operational Service View: Overview E Declaratively specifies the behavioral contracts between the component classes of the Realization Structural Class Service View of the subject component class E Shows: E The OCL precondition, postcondition or body constraints of the operations whose signatures are given in the Specification Realization Class Service View of the subject component class
Prototypical Realization Operational Service View E context CC 0: : op 01(in pa 011: Cl 2, inout p 012: Boolean, out p 013: Real): Cla pre: qboe 011 body: qoe 011 E context CC 0: : op 02(pa 021: Set(Integer)): Ordered. Set(Tuple(Integer, Strin g)) pre: qboe 021 post: pboe 021 E context CC 1: : op 11(pa 111: Bag(Cla)): Sequence(String) pre: qboe 111 E context CC 1: : op 12(): CC 2 post: qboe 121 E context CC 2: : op 21(): Clb post: qboe 211 E context Cla: : opa 1(in paa 11: Cl 2, inout paa 12: Boolean, out paa 13: Real): Clb pre: qboea 11 body: qoea 11 E context Cla: : opa 2(paa 21: Set(Integer)): Ordered. Set(Tuple(Integer, String ) E context Clb: : opb 2(): CC 1 post: qboeb 21 E context Clc: : opc 1(): Cla post: qboec 11 E Conventions: E q: OCL query expression E p: OCL postcondition expression E b: OCL boolean expression E oe: Ocl Expression E CC: Component Class E Cl: Class E op: Operation E pa: parameter
Realization Operational Service View: Reused UML 2/OCL 2 Metamodel Namespace Same as Specification Operational Service View 0. . 1 context Behavioral. Feature Named. Element owned. Rule * 0. . 1 pre. Context precondition * Class (from Kernel) 0. . 1 Operation 0. . 1 post. Context postcondition * Constraint 0. . 1 body. Context bodycondition * * owned. Operation Element * constrained. Element 0. . 1 context. Variable 0. . 1 result. Variable * parameter. Variable Typed. Element Whole OCL 2 Metamodel body. Expression Ocl. Expression * owning. Constraint specification 0. . 1 Value. Specification Opaque. Expression self. Owner 0. . 1 result. Owner 0. . 1 var. Owner 0. . 1 Expression In. Ocl top. Expression 0. . 1
Realization Operational Service View: Metamodel Kobr. A 2 Extension Operation Constraint Effect. Operation Behavioral. Constraint Pre Post Ocl. Expression Post. Exp Pre. Exp Same as Specification Operational Service View
Realization Operational Type View: Overview E Declaratively specifies the behavioral contracts between the component classes, (data) classes and association classes of the Realization Structural Type View of the subject component class E Shows: E The OCL precondition, postcondition or bodies constraints of the operations whose signatures are given in the Realization Structural Type View of the subject component class
Prototypical Realization Operational Type View Econtext Cla: : opa 1(in paa 11: Cl 2, inout paa 12: Boolean, out Econtext ACB: : op. B 2(): CC 1 paa 13: Real): Clb post: qboe. B 21 pre: qboea 11 Econtext ACC: : op. C 1(): Cla body: qoea 11 post: qboe. C 11 Econtext Cla: : opa 2(paa 21: Set(Integer)): Ordered. Set(Tuple(String, Integer) pre: qboea 21 post: pboea 21 Econtext Clb: : opb 1(pab 11: Bag(ACa)): Sequence(String) pre: qboeb 11 Econtext Clb: : opb 2(): CC 1 post: qboeb 21 Econtext Clc: : opc 1(): ACa post: qboec 11 Econtext ACA: : op. A 1(in pa. A 11: Cl 2, inout pa. A 12: Boolean, out pa. A 13: Real): Clb pre: qboe. A 11 body: qoe. A 11 Econtext ACA: : op. A 2(pa. A 21: Set(Integer)): Ordered. Set(Tuple(Integer, Strin g)) pre: qboe. A 21
Realization Operational Type View: Reused UML 2/OCL 2 Metamodel Namespace Same as Specification Operational Service View 0. . 1 context Behavioral. Feature Named. Element owned. Rule * 0. . 1 pre. Context precondition * Class (from Kernel) 0. . 1 Operation 0. . 1 post. Context postcondition * Constraint 0. . 1 body. Context bodycondition * * owned. Operation Element * constrained. Element 0. . 1 context. Variable Association Class 0. . 1 result. Variable * parameter. Variable Typed. Element Whole OCL 2 Metamodel body. Expression Ocl. Expression * owning. Constraint specification 0. . 1 Value. Specification Opaque. Expression self. Owner 0. . 1 result. Owner 0. . 1 var. Owner 0. . 1 Expression In. Ocl top. Expression 0. . 1
Realization Operational Type View: Metamodel Kobr. A 2 Extension Operation Constraint Effect. Operation Behavioral. Constraint Pre Post Ocl. Expression Post. Exp Pre. Exp Same as Specification Operational Service View
Realization Behavioral Algorithmic View: Overview E Defines the algorithms for each operation O 1, . . . , Om appearing the subject component's Realization Structural Class Service View E Contains m x n simple UML 2 activity diagrams, where n is the average number of activity diagrams needed to fully specify the algorithms implemented by O 1, . . . , Om
Prototypical Algorithmic View
Prototypical Algorithmic View
Realization Behavioral Algorithmic View: Reused UML 2/OCL 2 Metamodel 0. . 1 Activity in. Activity 0. . 1 group * contained. Edge * node in. Group contained. Node * * Activity. Group * * Activity Executable. Node incoming * source Edge Node edge target Behavior * Call. Behavior. Action outcoming * Action Control Flow Object Flow Control Node Parameter Object Node * Initial Node Activity Final Node Flow Final Node Join Node Fork Node Merge Node Decision Node Call. Action Invocation Action is. Synchronous: Boolean 0. . 1 Activity Parameter Node 0. . 1 * argument Pin Output. Pin Input. Pin result * target 0. . 1 Call. Operation. Action * Operation
Realization Behavioral Algorithmic View: Reused UML 2/OCL 2 Metamodel 0. . 1 Activity in. Activity edge * * edge Activity Edge source 0. . 1 in. Partition * partition 0. . 1 * in. Partition Activity. Partition node * * node * Behavior Activity incoming * Node target Class (from Kernel) outcoming * Executable. Node guard specification owning. Constraint Value. Specification 0. . 1 Constraint * top. Expression body. Expression * context * 0. . 1 Classifier context 0. . 1 Ocl. Expression 0. . 1 Action constrained. Element * owned. Rule Opaque. Expression. In. Ocl local. Postcondition Namespace
Realization Behavioral Algorithmic View: Reused UML 2/OCL 2 Metamodel Activity. Group Activity Edge interrupting. Edge interruptible. Region Interruptible 0. . 1 Activity. Region * node interrupts * * Activity Node handlerprotected. Node Redefinable Element Named Element Exception Handler * exception. Type * Excecutable Node * Object. Node Executable Node handler. Body exception. Input Action 1. . * Classifier Pin 0. . 1 Input. Pin Corrigir layout para evitar repetção de Executable. Node exception Raise Exception Action
Realization Behavioral Algorithmic View: Reused UML 2/OCL 2 Metamodel Activity. Group Activity Edge interrupting. Edge interruptible. Region Interruptible 0. . 1 Activity. Region * node interrupts * * Activity Node handlerprotected. Node Redefinable Element Named Element Exception Handler * exception. Type * Excecutable Node * Object. Node handler. Body exception. Input Action 1. . * Classifier Executable Node Pin 0. . 1 Input. Pin exception Raise Exception Action
Realization Behavioral Algorithmic View: Metamodel Kobr. A 2 Extension Action Call. Behavior. Action Call. Operation. Action Raised. Exception. Action Exception. Handler Object. Flow Action. In. Ocl Call. Sub. Activity. Action Call. Operation. Action Raised. Exception. Action Exception. Handler
Kobr. A 2 Process Model. Component «local. Postcondition» a=subject. is. Abstract() Model. Specification. View [a=true] sv [a=false] Model. Realization. View rv a
Kobr. A 2 Process Model. Specification. View «local. Postcondition» csvnpt = csv. packaged. Element->select(ocl. Is. Kind. Of(Parameter)). type->reject(ocl. Is. Kind. Of(Primitiv «local. Postcondition» let pe = ctv. packaged. Element, ctvop = pe->select(ocl. Is. Kind. Of(Operatio csvop = csv-> select(ocl. Is. Kind. Of(Operat in ctvnop = ctvop - csvop Model Class csvnpt Service View csv «decision. Input» No operation of csv can be specified declaratively [else] [no] [csvnpt->Is. Empty()] [yes] Model Operational Service View osv «decision. Input» There is some component object connection pattern of specific interest [csvnop->Is. Empty()] [yes] [no] Model Instance Service View isv sv Model Class ctv Type View ctvpop [else] Model Instance itv Type View Model Operational otv Type View [yes] «decision. Input» There is some object connection [no] pattern of specific interest
Prototypical Specification Structural Instance Service View «acquires. Link» «Component. Object» CO 3 b: CC 3 «acquires. Link» «subject» «Component. Object» «acquires. Link» «Component. Object» C 01 a: CC 1 CO 3 a: CC 3 l. C 03 a. C 01 a a 1 C 01 a = v 1 C 01 a l. C 02 a. C 01 a «createss. Link» l. C 02 n. C 01 a «Component. Object» C 02 a: CC 2 C 02 b: CC 2 a 1 C 02 a= v 1 C 02 a a 1 C 02 a = v 1 C 02 b «subject» «Component. Object» C 01 b: CC 1 a 1 C 01 b = v 1 C 01 b «createss. Link» l. C 01 b. C 02 a «Component. Obj ect» C 02 c: CC 2
- Slides: 86