QVT 1.0 NO IDEA Avatar
  1. OMG Issue

QVT — Missing text for notation for class properties in Section 8.4.6

  • Key: QVT-37
  • Legacy Issue Number: 11025
  • Status: closed  
  • Source: France Telecom R&D ( Mariano Belaunde)
  • Summary:

    In 8.4.5 the text describes the notation for defining classes. However the notation
    For describing properties within classes is not indicated. Also notation for primitive
    data type is not indicated

  • Reported: QVT 1.0b1 — Fri, 18 May 2007 04:00 GMT
  • Disposition: Resolved — QVT 1.0
  • Disposition Summary:

    (1) In Section 8.4.5 replace the sentence:
    "The properties of a class are notated using a declarator made of: a name, a type, optional property qualifiers (derived, static, …) and a initialisation expression.
    isStatic : Boolean = 0;
    "
    By the following, text:

    "The properties of a class are notated using a declarator made of: a name, a type, optional property qualifiers and an optional initialisation expression.
    The general syntax pattern is:

    <qualifier>* <propname> ':' <typespec> ('=' <init>)? '<multiplicity>'? 'ordered'?
    (opposites <propname>)?

    For properties typed by primitive types or collection of primitive types, the valid property qualifiers are 'derived' and 'readonly' to represent respectively a derived attribute or a readonly attribute. When provided, the initialization value for a derived attribute represents the expression used to compute the value of the derived property.

    The syntax of multiplicity specification follows the regular convention from UML, where brackets sourrounds the definition (such as [0..1], [1], [*] and [0..*]). When absent the [0..1] multiplicity is assumed.

    Examples:
    isStatic : Boolean = 0;
    values : Sequence(String);
    derived size : Integer = self.ownedElement->size();

    To indicate that an attribute acts as a qualifying identifier for the class, a stereotype qualifier named 'id' is used. The syntax for stereotyped qualifiers is:
    '<<' <IDENTIFIER> (',' <IDENTIFIER>)? '>>'
    Example: <<id> uuid:String [1]; // a mandatory qualifying uuid attribute

    For properties referencing non primitive types, the same syntax is used except that the 'composes' or 'references' qualifier is used to distinguish between composite or non composite association ends. The 'opposites' keyword is used to indicate the opposite property if any.

    Example:
    composes ownedElement : Element [*] ordered opposites namespace;
    references usedElement : Element [*];

    (2) In Section 8.4.5, before "an enumeration type…" add the following sentence "A primitive type is declared using the 'primitive' keyword.
    'primitive' <primitivetypename>.
    Example: primitive Double;

    (3) In Section 8.4.5, after presenting the notation for primitive types, adds the following sentence.
    An exception is declared using the 'exception' keyword followed by the name of the exception. Inheritance between exceptions is introduced usin the 'extends' keyword.
    Example: exception VeryStrangeException extends UnexpectedException;

    Remark: For the BNF grammar modification see resolution of 10026.
    Note: Fix in resolution text: (opposites <propname>)? Should be replaced by
    (opposites '' ? <propname> <multiplicity>?) to be inline with grammar. Also, after 'the opposite property if any.' add "When present, the '' annotation indicates that the opposite property is not navigable".

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