UML 2.6 RTF Avatar
  1. OMG Issue

UMLR — Serilaization of required stereotypes

  • Key: UMLR-458
  • Legacy Issue Number: 18436
  • Status: open  
  • Source: Airbus Group ( Yves Bernard)
  • Summary:

    There are some specific cases where serialization of Extension instances resulting from the application of a stereotype does not provide any added value. However it creates a memory footprint overhead. These cases can be characterized by the conjunction of the following conditions:
    The stereotype is defined so that it is an required extension (i.e. its isRequired property is “true”)
    This stereotype does not have any property or all of its properties are derived (i.e. isDerived is “true”)

    As per the current specifications of UML and MOF2XMI, I cannot find anything that formally implies the serialization of extensions resulting from the application of such a stereotype but this reading appears to be controversial (cf. the attached mails exchange).

    Nevertheless, the standard way to add semantics in a profile relies on stereotypes definition only and there are some practical cases leading to defined stereotypes of the kind described above. For instance, within the SysML specification we defined a set of queries to retrieve elements involved in a specific kind of relationships (e.g. allocation), even if those elements do not themselves hold any information about it.

    Finally, those stereotypes are no more that a specification mechanism used to define a set of query applicable to a set of elements and the memory footprint overhead is not justified.

    Suggested resolution:
    To add a Boolean query (with maybe a corresponding derived property) to the Extension metaclass. This will return “true” when an extension shall be serialized. I propose to use the following OCL expression to specify this query:

    context Extension
    def: mustBeSerialized() : Boolean = self.isRequired=false or self.ownedEnd.type.attribute->select(isDerived)->notEmpty()

    To clarify that extensions that return “false” to the query above are aliases for their base classes in any context where the profile is applied. Therefore, any reference to an element typed by the corresponding stereotype shall actually be resolved (and then serialized) as a reference to the corresponding instance of the extended class.

  • Reported: UML 2.5b1 — Mon, 11 Feb 2013 05:00 GMT
  • Updated: Fri, 6 Mar 2015 20:57 GMT