QVT 1.3 RTF Avatar
  1. OMG Issue

QVT13 — QVTo: Typedef for Standard Library predefined types

  • Key: QVT13-13
  • Legacy Issue Number: 13252
  • Status: closed  
  • Source: Open Canarias, SL ( Adolfo Sanchez-Barbudo Herrera [X] (Inactive))
  • Summary:

    As interpretated from the especification (pag 104), the way of adding new operations to OCL predefined types is creating new Typedef instances
    which must have the OCL predefined type as the base type. The new operations are added to this new typedef. However there are several problems:
    1. The specification doesn't provide any name for these typedefs.
    2. The specification doesn't specify which type (QVT typedef or OCL predefined type) should be used when referencing such OCL predefined types in a QVTo transformation.

    Solution for 1).
    Suggestion a: Name the typedef with the same name of the base type. This provokes name's clash with the predefined type's name, due to there are two different types from two standard libraries
    which have the same name. A possible solution, would be expliciting that typedefs (aliases) will never clash its name with its base type.

    Suggestion b: Name the tpyedef with a different name, such as QVToXXXXXX or XXXX_Alias.

    Solution for 2).
    Suggestion a: Taking the typedef as the referenced type in QVTo transformations.
    Suggestion b: Taking the OCL predefined type as the referenced type in QVTo transformations.
    Suggestion c: Considering resolution of issue 13168, so that only OCL predefined exists, and therefore, the only type which can be referenced.

    It's a little bit weird having 2 different types (a type, and its alias typedef) which represent just the same type, specially when they are related by a reference.
    My solution's preference in order are:
    Suggestion c: Just having one type to refer.
    Suggestion a: Since the typedef "extends" the behaviour of the predefined type (adding new operations), the former must be the referred one.
    Suggestion b: The OCL predefined type is referenced, but we must take into account that the operations added to the typedef are also available.

  • Reported: QVT 1.0 — Tue, 13 Jan 2009 05:00 GMT
  • Disposition: Resolved — QVT 1.3
  • Disposition Summary:

    QVTo Standard Library and typedefs Issue. Extending OCL predefined types

    As interpretated from the especification (pag 104), the way of adding new operations to OCL predefined types is creating new Typedef instances
    which must have the OCL predefined type as the base type. The new operations are added to this new typedef. However there are several problems:
    1. The specification doesn't provide any name for these typedefs.
    2. The specification doesn't specify which type (QVT typedef or OCL predefined type) should be used when referencing such OCL predefined types in a QVTo transformation.

    Solution for 1).
    Suggestion a: Name the typedef with the same name of the base type. This provokes name's clash with the predefined type's name, due to there are two different types from two standard libraries
    which have the same name. A possible solution, would be expliciting that typedefs (aliases) will never clash its name with its base type.

    Suggestion b: Name the tpyedef with a different name, such as QVToXXXXXX or XXXX_Alias.

    Solution for 2).
    Suggestion a: Taking the typedef as the referenced type in QVTo transformations.
    Suggestion b: Taking the OCL predefined type as the referenced type in QVTo transformations.
    Suggestion c: Considering resolution of issue 13168, so that only OCL predefined exists, and therefore, the only type which can be referenced.

    It's a little bit weird having 2 different types (a type, and its alias typedef) which represent just the same type, specially when they are related by a reference.
    My solution's preference in order are:
    Suggestion c: Just having one type to refer.
    Suggestion a: Since the typedef "extends" the behaviour of the predefined type (adding new operations), the former must be the referred one.
    Suggestion b: The OCL predefined type is referenced, but we must take into account that the operations added to the typedef are also available.

    Discussion

    The offending sentence is:

    This is specifically used in the QVT standard library to attach operations to pre-defined primitive types, like String and Collections.

    This facility is not used anywhere in the specification and there is no grammar that facilitates it. No model of the QVTo library is provided that exploits it. The sentence is therefore just an observation on a particular implementation approach.

    The approach takes no account of the very similar requirement for Complete OCL to extend types. This is being resolved by work towards OCL 2.5 / 3.0 with which QVTo will almost certainly have to comply.

    Therefore, tomorrow this sentence will be embarassing and incompatible. Today it is just irrelevant and confusing.

  • Updated: Tue, 29 Mar 2016 15:09 GMT