Issue 14591: OCL 2.1 12 Definition Accessibility Semantics (ocl2-rtf) Source: Model Driven Solutions (Dr. Edward Willink, ed(at)willink.me.uk) Nature: Uncategorized Issue Severity: Summary: Given the following: context MyClass def : isaMethod() : Boolean = let Collection(Operation) myOperations = oclType().oclAsType(Class).ownedOperations() in myOperations->exists(name = 'isaMethod') is the value of isaMethod() true or false? This is a more fundamental way of looking at the AST serializability problem in Issue 12854. (The suggested referredDefinition : Constraint [0..1] will not work because there may be 3 operation constraints and two property constraints.) isaMethod() = false: OCL defininitions are not first class features and so there is no need to support their serialization. isaMethod() = true: OCL definitions do as implied by Section 12.5 and provide reusable sub-expressions that can be used in an identical way to an atribute or operation. It seems that an OCL evaluation needs to be defined in the following way. Phase 1. Load MOF/UML meta-models and OCL contributions Phase 2: Merge OCL definitions into MOF/UML meta-models Phase 3: Execute the OCL to support queries/invariants/... on models Phase 2 solves 12854 by requiring a merged meta-model to reify all definitions. How the merged model is serialized is an implementation issue Resolution: Revised Text: Actions taken: October 31, 2009: received issue Discussion: End of Annotations:===== s is issue # 14591 OCL 2.1 12 Definition Accessibility Semantics Given the following: context MyClass def : isaMethod() : Boolean = let Collection(Operation) myOperations = oclType().oclAsType(Class).ownedOperations() in myOperations->exists(name = 'isaMethod') is the value of isaMethod() true or false? This is a more fundamental way of looking at the AST serializability problem in Issue 12854. (The suggested referredDefinition : Constraint [0..1] will not work because there may be 3 operation constraints and two property constraints.) isaMethod() = false: OCL defininitions are not first class features and so there is no need to support their serialization. isaMethod() = true: OCL definitions do as implied by Section 12.5 and provide reusable sub-expressions that can be used in an identical way to an atribute or operation. It seems that an OCL evaluation needs to be defined in the following way. Phase 1. Load MOF/UML meta-models and OCL contributions Phase 2: Merge OCL definitions into MOF/UML meta-models Phase 3: Execute the OCL to support queries/invariants/... on models Phase 2 solves 12854 by requiring a merged meta-model to reify all definitions. How the merged model is serialized is an implementation issue