Issue 13252: QVTo Standard Lybrary and typedefs Issue. Extending OCL predefined types (qvt-rtf) Source: Open Canarias, SL (Mr. Adolfo Sanchez-Barbudo Herrera, nobody) Nature: Uncategorized Issue Severity: 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. Resolution: 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. Revised Text: In 8.2.2.24 Typedef delete This is specifically used in the QVT standard library to attach operations to pre-defined primitive types, like String and Collections. Actions taken: January 13, 2009: received issue December 22, 2015: Resolved March 29, 2016: closed issue Discussion: It is hard to tackle this properly until the OCL type system is clearer. OCL 2.5 should define what it means to prepare a loaded metamodel for OCL usage. This definition can form the basis of a QVT clarification.. Disposition: Deferred End of Annotations:===== ender: Adolfo Sanchez Barbudo Date: Tue, 13 Jan 2009 17:13:34 +0000 From: Adolfo Sánchez-Barbudo Herrera Organization: Open Canarias S.L. User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) To: Juergen Boldt Subject: MOF QVT RTF issue: QVTo Standard Lybrary and typedefs Issue. Extending OCL predefined types. Hi Juergen, I think that the issue which I sent you in my last email has not been included. I definitely will use the issues@omg.org email address to send issues, so that they are well organized, and I can format them. When you are able to, please, only add the following one (which I haven't sent to that address in order to not confuse you). Regards, Adolfo. ** QVTo Standard Lybrary 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. -- Adolfo Sánchez-Barbudo Herrera adolfosbh(at)opencanarias(dot)com C/Elías Ramos González, 4, ofc. 304 38001 SANTA CRUZ DE TENERIFE Tel.: +34 922 240231 / +34 617 718268