OCL 2.1 RTF Avatar
  1. OMG Issue

OCL21 — notation for selecting unique element within a list should be more concise

  • Key: OCL21-209
  • Legacy Issue Number: 6881
  • Status: closed  
  • Source: France Telecom R&D ( Mariano Belaunde)
  • Summary:

    Suggestion: Use brackets with a "!" prefixing mark
    Example:
    self.ownedElement! #Class and name="MyClass"
    means
    self.ownedElement->select(oclIsKindOf(Class) and name="MyClass")->first()

  • Reported: OCL 2.0b2 — Wed, 7 Jan 2004 05:00 GMT
  • Disposition: Resolved — OCL 2.1
  • Disposition Summary:

    The suggested syntax comes from QVTo.
    Non-trivial OCL expressions can be difficult to read. Introducing shorthand notations compromises readability. At present OCL has "." and "->" shorthands that cause significant difficulties. Introducing more does not seem appropriate for the standard language.
    Disposition: Closed, no change

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