OCL 2.5 RTF Avatar
  1. OMG Issue

OCL25 — OCL 2.1 12 Definition Accessibility Semantics

  • Key: OCL25-194
  • Legacy Issue Number: 14591
  • Status: open  
  • Source: Model Driven Solutions ( Dr. Edward Willink)
  • 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

  • Reported: OCL 2.1 — Sat, 31 Oct 2009 04:00 GMT
  • Updated: Thu, 8 Oct 2015 14:12 GMT