Issue 6012: OCL/MOF/UML alignment (ocl2-ftf) Source: (Mr. Wim Bast, wim.bast@xs4all.nl) Nature: Uncategorized Issue Severity: Summary: Document ad/2003-05-01 contains directions along which the OCL metamodel and the UML Infrastructure metamodel can be integrated to form one single language. The OCL has originally been conceived as part of the UML language, and has never been intended to be used separately. A tight connection between the two metamodels is nessesary for all modelers that want to use either UML, OCL, MOF, or a combination of these. Within the OMG the OCL is heavily used for specifyingconstraints on metamodels in the varous OMG standards. OCL is also used extensively in many of the proposals for the MOF 2.0 QVT RfP, as the solution for a query language, and as part of a transformation definition language. In all these cases, the OCL is used at the metamodel level, i.e. at the MOF level. Formally this is incorrect, because OCL isn't part of the MOF. Within the UML/MOF/OCL 2.0 framework, the UML and the MOF share a common core. The MOF 2.0 proposal reuses the UML 2.0 Infrastucture. By integrating the OCL into the reused part of the UML 2.0 infrastructure, the OCL metamodel is integrated with the MOF 2.0 as well. The definition of OCL at the MOF level is then achieved. Some aspects of the coupling of the OCL metamodel with the UML Superstructure metamodel are addressed in document ad/2003-05-01 as well. Resolution: Revised Text: The revised text is given for each chapter. Chapter 8 (Abstract Syntax) *********************** 0) In 8.2, in the introductory text, removes the "with the annotation (from <UML package>) and shown with". 1) In 8.2, replaces "… from the UML Infrastructure" by "…from the UML Superstructure". 2) In 8.2.1 (Type conformance), within the well-formedness rules of Classifier, replaces 'generalization.parent' by 'generalization.general'. 3) In all the text replace 'Primitive' as 'PrimitiveType', 'PropertyCall' by ''CallExp', 'ModelPropertyCallExp' by 'FeatureCallExp', 'AssociationEndCallExp' by 'PropertyExp', remove AttributeCallExp. Update figure 6 and figure 7 to take into account these changes: TypedElement Classifier TypeExp 0..1 * +referredType FeaturePropertyCall LiteralExp IfExp MessageExp IteratorExp VariableExp ParameterFeaturePropertyCall OperatioOperationCallExp n 0..1 * +referredOperation +referringExp OclExpression * 0..1 +argument {ordered} +parentCall PropertyCallExp Property * 0..1 +referredProperty +re*ferringExp NavigationCallExp * 0..1 +qualifier {o*rdered} +parentNav 0..1 * +navigationSource 4) In the well-formedness rules of TupleType, replace 'allAttributes' by 'allProperties'. 5) In 8.3.8, in Classifier subtitle, after the definition of lookupSignal add the following text: """ def: allReceptions() : Set(Reception) = self.allFeatures()->select(f | f.oclIsKindOf(Reception)) def: allProperties() : Set(Property) = self.allFeatures()->select(f | f.oclIsKindOf(Property)) def: allOperations() : Set(Property) = self.allFeatures()->select(f | f.oclIsKindOf(Operations)) The operation allFeatures() is defined in the UML semantics. """ 6) In 8.3.8, in Classifier subtitle, remove the paragraph starting with "Operations allAttributes … " and ending with "…inherited Attributes". Also remove the OCL code of allReceptions after the removed paragraph (since added in step 5 above). 7) Replace the existing chapter 13 by the new content below. The title of the chapter is Basic OCL and Essential OCL. 13 Basic OCL and Essential OCL 13.1. Introduction: BasicOCL is the package exposing the minimal OCL required to work with Core::Basic. Basic OCL depends on the Core::Basic Package. It references explicitly the following Core::Basic classes: Property, Operation, Parameter, TypedElement, Type, Class, DataType, Enumeration, PrimitiveType and EnumerationLiteral. EssentialOCL is the package exposing the minimal OCL required to work with EMOF. EssentialOcl depends on the EMOF Package. It references explicitly the EMOF classes:Property, Operation, Parameter, TypedElement, Type, Class, DataType, Enumeration, PrimitiveType and EnumerationLiteral. EssentialOCL is build from Core::Basic and BasicOcl using package merge with copy semantics – similarily as EMOF is build from Core::Basic. Structurally there is no difference between BasicOCL and EssentialOCL. For this reason we provide in this chapter a unique set of diagrams which defines the abstract syntax for both packages. For convenience, because BasicOCL (respectively EssentialOCL) is - conceptually – a subset of the complete OCL language for UML superstructure, we will not repeat or redefine here all the class descriptions and the well-formedness rules defined in the other chapters. When applicable, all these definitions are to be re-interpreted in the specific context of Core::Basic (respectively EMOF). The section "OCL adaptation for metamodelling" specific rules for the re-interpretation of the "complete" OCL, whereas the "Diagrams" section provides the complete diagrams defining the BasicOCL (respectively EssentialOCL) abstract syntax. 13.2. OCL adaptation for metamodelling We provide below a set of rules and conventions that are applied to define BasicOCL (and consequently EssentialOCL) from the OCL defined for UML superstructure – called "complete OCL" in this section. 1) The following metaclasses defined in complete OCL are not part of BasicOCL (and EssentialOCL): - MessageType - ElementType - AssociationClassCallExp - MessageExp - StateExp - UnspecifiedValueExp Any well-formedness rules defined for these classes are consequently not part of the definition of Basic OCL. The properties NavigationCallExp::qualifier and NavigationCallExp::navigationSource are suppressed since not needed in this context. 2) Core::Basic does not contain the intermediate notion of Classifier but uses instead directly the Type notion as the base class for the type system. Consequently, any reference to the Classifier class in the complete OCL specification has to be re-interpreted as a reference to the Type class. Note: It is expected that further revisions of this specification will provide explicily the complete set of well-formedness rules and additional operations that apply to Core::Basic – to replace the lazy re-interpretation statement we are using here.3) In complete OCL, TupleType has DataType as base type. In BasicOCL Tuple has also Class as base type so that the attributes of the tuple can be defined in the same way as in complete OCL – as Property instances. 4) In complete OCL, pre-defined types have pre-defined operations defined in the standard library. However, a DataType in Core::Basic cannot define such operations since it inherits from Type (and not from Class). For all data types and special types – like VoidType, InvalidType and AnyType – the following convention is used: in the standard library the instance representing the pre-defined type is accompanied with a class instance with the same name that holds the operations. An access to an operation of the predefined type implies an access to the operation of the complementary class instance. 13.3. Diagrams The diagrams below define completely the abstract syntax of BasicOCL (respectively EssentialOCL). The classes that are not imported from Core::Basic (respectively EMOF) are shown with a transparent fill color. VoidType DataType Class TupleType SetTypOrderedSetType SequenceType BagType e Type CollectionType PrimitiveType InvalidType TypeType AnyType +elementType 1 * Figure 34 : TypesTypedElement Figure 35 : The top container expression TypedElement Type TypeExp FeaturePropertyCall LiteralExp IfExp IteratorExp VariableExp Parameter IterateExp CallExp LoopExp OclExpression Variable +referredType 0..1 * +referringExp * +representedParameter 0..1 +baseExp 0..1 +appliedElement 0..1 +loopExp 0..1 +loopBodyOwner 0..1 +source 0..1 +body 1 +initExpression 0..1 +referredVariable 0..1 +variable * +iterator * +result 0..1 0..1+initializedElement 1 Figure 16 : main expression conceptsFeaturePropertyCall Operation OperationCallExp OclExpression PropertyCallExp Property NavigationCallExp +referredOperation 0..1 +referringExp * +parentCall 0..1 +argument {ordered} * +re*ferringExp +referredProperty * 0..1 Figure 37: Feature Property Call expressions OclExpression IfExp 1 0..1 +condition +ifOwner 1 0..1 +thenExpression +thenOwner 1 0..1 +elseExpression +elseOwner Figure 2 : If Expressions LetExp OclExpression 0..1 +in Variable 0..1 1 +variable 0..1 0..1 +initExpression +initializedElement Figure 38: Let expressionsLiteralExp EnumerationLiteral EnumLiteralExp 0..1 * +referredEnumLiteral +literalExp PrimitiveLiteralExp NumericLiteralExp NullLiteralExp InvalidLiteralExp Figure 39 : Literals CollectionLiteralPart CollectionLiteralExp kind : CollectionKind * 1 +part CollectionRange OclExpression 1 0..1 +first +firstOwner 1 0..1 +last +lastOwner CollectionItem 1 0..1 +item LiteralExp CollectionKind Set OrderedSet Bag Sequence <<enumeration>> TypedElement TupleLiteralExp Property TupleLiteralPart * 0..1 +part 0..1 0..1 +attribute Figure 40 : Collection and tuple literals Document ptc/2005-06-05 Page 34 Actions taken: July 22, 2003: received issue November 1, 2005: closed issue Discussion: Resolution: The approach taken to solve the alignment problem is as follows: - Chapters 7 to chapters 12 define the OCL for the UML superstructure language. The OCL metamodel specification, notation and semantics is updated when needed to reflect the changes made in the last version of the UML2 superstructure specification. - Chapters 13 define the OCL that is required for metamodelling. More precisely, chapter 13 defines firstly the BasicOCL package extending the UML Core::Basic package to allow the integration of OCL in languages that are built on the basis of the Infrastructure Library. The chapter also defines the EssentialOCL package extending EMOF for OCL integration. Conceptually, EssentialOCL is build from from BasicOCL using the same principles used to define the EMOF package from the Core::Basic library package. Structurally there is no difference between BasicOCL and EssentialOCL. Also, because no new concept is introduced by BasicOCL and EssentialOCL the class descriptions are not repeated, only the diagrams are showed. End of Annotations:===== From: "Bast, Wim" To: "'issues@omg.org'" Subject: new ocl2-ftf issue Date: Tue, 22 Jul 2003 15:17:25 +0200 X-Mailer: Internet Mail Service (5.5.2653.19) Source: Compuwrae Corporation, Wim Bast (wim.bast@nl.compuware.com) Nature: Uncategorized Issue Severity: Summary: Document ad/2003-05-01 contains directions along which the OCL metamodel and the UML Infrastructure metamodel can be integrated to form one single language. The OCL has originally been conceived as part of the UML language, and has never been intended to be used separately. A tight connection between the two metamodels is nessesary for all modelers that want to use either UML, OCL, MOF, or a combination of these. Within the OMG the OCL is heavily used for specifyingconstraints on metamodels in the varous OMG standards. OCL is also used extensively in many of the proposals for the MOF 2.0 QVT RfP, as the solution for a query language, and as part of a transformation definition language. In all these cases, the OCL is used at the metamodel level, i.e. at the MOF level. Formally this is incorrect, because OCL isn't part of the MOF. Within the UML/MOF/OCL 2.0 framework, the UML and the MOF share a common core. The MOF 2.0 proposal reuses the UML 2.0 Infrastucture. By integrating the OCL into the reused part of the UML 2.0 infrastructure, the OCL metamodel is integrated with the MOF 2.0 as well. The definition of OCL at the MOF level is then achieved. Some aspects of the coupling of the OCL metamodel with the UML Superstructure metamodel are addressed in document ad/2003-05-01 as well. Resolution: see document ad/2003-05-01 Revised Text: Actions taken: -- The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it.