OCL 2.1 RTF Avatar
  1. OMG Issue

OCL21 — Provide specific notational support when testing stereotypes

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

    Suggestion: Use the STAR character. Quotes could be used in case of blanks
    characters in stereotype names.
    Example: self.ownedElement.select(kindOf(Class) and *EJBEntity)
    returns all the classes stereotyped by the EJBEntity stereotype or a derived
    stereotype.
    Example: self.ownedElement.select(kindOf(Class) and **EJBEntity)
    returns all the classes stereotyped by the EJBEntity stereotype.

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

    Stereotype support is certainly required, but I think much of the trouble is inadequate tooling. The examples can be realised by:
    self.ownedElement->select(oclIsKindOf(Class)).oclAsType(Class) ->select(extension_EJBEntity <> null)
    self.ownedElement->select(oclIsKindOf(Class)).oclAsType(Class) ->select(extension_EJBEntity.oclIsTypeOf(EJBEntity))
    The clumsy ->select(oclIsKindOf(Class)).oclAsType(Class) 'idiom' is resolved by the selectByKind library operation from Issue 18829 to give
    self.ownedElement->selectByKind(Class)->select(extension_EJBEntity <> null)
    self.ownedElement->selectByKind(Class)->select(extension_EJBEntity.oclIsTypeOf(EJBEntity))
    Given that UML specified the magic "extension_" and "base_" prefixes, it seems best to encourage rather than obscure them.
    Disposition: Closed, no change

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