UML 2.4 RTF Avatar
  1. OMG Issue

UML24 — UML 2.4: Inconsistent rendering of OCL in UML metamodel

  • Key: UML24-71
  • Legacy Issue Number: 15378
  • Status: closed  
  • Source: Model Driven Solutions ( Mr. Steve Cook)
  • Summary:

    This is a UML 2.4 issue please:

    Inconsistent rendering of OCL in UML metamodel.

    According to the conventions mostly applied in the UML metamodel, the specifications of the body conditions of operations have the form “result = <OCL expression>” and the operation is specified to have a return parameter named “result”. Invariants, pre- and post-conditions, on the other hand, are simply Boolean expressions with no “result = “. Note that many invariants are specified in OCL as “true”, being placeholders for invariants that are currently only specified in text. There are some placeholder operations, for which the specification should be “result = <default value for the type of result>”, i.e. result = false, result = 0, or result = null.

    Applying these conventions consistently will greatly enable future generation of specification documents. This means making the following changes:

    All operations in the metamodel should be changed to have a return parameter named “result”.

    The following operation and constraint specifications should be changed as indicated by changeto:

    InfrastructureLibrary::Core::Constructs::Classifier::hasVisibilityOf()

    “hasVisibilityOf = (n.visibility <> VisibilityKind::private)” changeto “result = (n.visibility <> VisibilityKind::private)”

    InfrastructureLibrary::Core::Constructs::Classifier::inheritedMember()

    “self.inheritedMember->includesAll(self.inherit(self.parents()>collect(p|p.inheritableMembers(self))>asSet()))” changeto “result = self.inherit(self.parents()>collect(p|p.inheritableMembers(self))>asSet())”

    UML::Classes::Kernel::Classifier::hasVisibilityOf()

    “hasVisibilityOf = (n.visibility <> VisibilityKind::private)” changeto “result = (n.visibility <> VisibilityKind::private)”

    UML::Classes::Kernel::Classifier::inheritedMember()

    “self.inheritedMember->includesAll(self.inherit(self.parents()>collect(p|p.inheritableMembers(self))>asSet()))” changeto “result = self.inherit(self.parents()>collect(p|p.inheritableMembers(self))>asSet())”

    UML::Classes::Kernel::OpaqueExpression::value()

    “true” changeto “result = 0”

    UML::Classes::Kernel::VisibilityKind::bestVisibility()

    “pre: not vis->includes(#protected) and not vis->includes(#package)” changeto “not vis->includes(#protected) and not vis->includes(#package)”

    UML::Deployments::ComponentDeployments::DeploymentSpecification

    “result = self.deployment->forAll (d | d.location..oclIsKindOf(ExecutionEnvironment))” changeto “self.deployment->forAll (d | d.location.oclIsKindOf(ExecutionEnvironment))”

    UML::Deployments::Nodes::CommunicationPath

    “result = self.endType->forAll (t | t.oclIsKindOf(DeploymentTarget))” changeto “self.endType->forAll (t | t.oclIsKindOf(DeploymentTarget))”

    UML::Interactions::Fragments::InteractionUse

    Two placeholder invariants specified as “N/A” –changeto- “true”

    UML::StateMachines::BehaviorStateMachines::StateMachine::LCA()

    “true” – changeto- “result = null”

  • Reported: UML 2.3 — Wed, 21 Jul 2010 04:00 GMT
  • Disposition: Resolved — UML 2.4
  • Disposition Summary:

    Agree to the changes proposed in the summary, except for OpaqueExpression::value() and StateMachine::LCA(). For these operations the result is undefined so it is incorrect to return a defined result. Instead a body of true is actually correct: it is logically equivalent to result=result.

  • Updated: Fri, 6 Mar 2015 20:58 GMT