OCL 2.5 RTF Avatar
  1. OMG Issue

OCL25 — OCL 2.1 Feature Overloading Semantics are not defined

  • Key: OCL25-92
  • Legacy Issue Number: 14986
  • Status: open  
  • Source: Model Driven Solutions ( Dr. Edward Willink)
  • Summary:

    OCL supports feature overloading and attempts to comply with UML. OCL does not define feature overloading itself. UML leaves feature overloading as a semantic variation point.

    The OCL behaviour is therefore undefined. However a variety of behaviours particularly those involving null and invalid only make sense if operations are selected at run-time according to the dynamic type.

    The example from an earilier pending issue:

    Sequence(OclAny)

    {3, 3.0, '3'}

    >count((-3)) = 2

    wherein

    UnlimitedNatural 3 widens to Integer 3 for successful comparison with Integer 3
    Real 3.0 is successfully compared to Integer 3 widened to Real
    String '3' widens to OclAny and fails to compare to Integer 3 widened to OclAny.

    is difficult to realise if static type resolution is applicable in which case all pair-wise value comparisons would use OclAny::= rather than Real::=.

    Suggest:

    OCL define that features are selected dynamically at run-time.

  • Reported: OCL 2.1 — Mon, 18 Jan 2010 05:00 GMT
  • Updated: Wed, 9 Mar 2016 15:48 GMT