Issue 13103: element creation and element attachment/detachment to/from an extent (qvt-rtf) Source: Open Canarias, SL (Mr. E. Victor Sanchez, vsanchez(at)opencanarias.com) Nature: Enhancement Severity: Minor Summary: Suggestion: In the Operational Mappings language, element creation and element attachment/detachment to/from an extent should be seen and treated as two different and independent activities. Once an element is created via an ObjectExp, this element is usually attached to another element immediately afterwards, which becomes its container, so the ObjectExp semantics of assigning it to an explicit or inferred extent becomes an unnecessary overhead. And also there are other times when we need to assign to an extent some model elements that may have been created at an unrelated time. They could even exist prior to the transformation execution. A case where this is relevant is with the result of a 'Element::clone()' or 'Element::deepclone()' operation execution. Is it expected that these model elements must belong by default to the same model as the original? How to clone parts of an extent with direction kind == 'in'? How to make them become part of the Set of root elements of another, different extent? Resolution: Revised Text: Actions taken: November 21, 2008: received issue Discussion: End of Annotations:===== m: webmaster@omg.org Date: 21 Nov 2008 15:50:31 -0500 To: Subject: Issue/Bug Report -------------------------------------------------------------------------------- Name: E. Victor Sánchez Company: Open Canarias S.L. mailFrom: vsanchez@opencanarias.com Notification: Yes Specification: MOF QVT Section: 8.2.1.24 FormalNumber: formal/2008-04-03 Version: 1.0 RevisionDate: 04/03/2008 Page: 86-87 Nature: Enhancement Severity: Minor HTTP User Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.4) Gecko/2008111317 Ubuntu/8.04 (hardy) Firefox/3.0.4 Description Suggestion: In the Operational Mappings language, element creation and element attachment/detachment to/from an extent should be seen and treated as two different and independent activities. Once an element is created via an ObjectExp, this element is usually attached to another element immediately afterwards, which becomes its container, so the ObjectExp semantics of assigning it to an explicit or inferred extent becomes an unnecessary overhead. And also there are other times when we need to assign to an extent some model elements that may have been created at an unrelated time. They could even exist prior to the transformation execution. A case where this is relevant is with the result of a 'Element::clone()' or 'Element::deepclone()' operation execution. Is it expected that these model elements must belong by default to the same model as the original? How to clone parts of an extent with direction kind == 'in'? How to make them become part of the Set of root elements of another, different extent? Sender: Victor Sanchez Date: Thu, 08 Jan 2009 14:05:37 +0000 From: Victor Sanchez User-Agent: Thunderbird 2.0.0.18 (X11/20081125) To: qvt-rtf@omg.org Subject: Concerning Issue 13103 X-Enigmail-Version: 0.95.0 Hello, guys! It's Victor Sánchez, a colleague of Adolfo's in Open Canarias. I just wanted to point out that when I submitted QVT's Issue #13103 last year, I did not mention any suggestions to solve the stated problem. I don't know how to update that issue to include suggestion information. I'm afraid I cannot do that. The contents of the submitted issue follows: ************************************ In the Operational Mappings language, element creation and element attachment/detachment to/from an extent should be seen and treated as two different and independent activities. Once an element is created via an ObjectExp, this element is usually attached to another element immediately afterwards, which becomes its container, so the ObjectExp semantics of assigning it to an explicit or inferred extent becomes an unnecessary overhead. And also there are other times when we need to assign to an extent some model elements that may have been created at an unrelated time. They could even exist prior to the transformation execution. A case where this is relevant is with the result of a 'Element::clone()' or 'Element::deepclone()' operation execution. Is it expected that these model elements must belong by default to the same model as the original? How to clone parts of an extent with direction kind == 'in'? How to make them become part of the Set of root elements of another, different extent? ************************************ A possible solution, which is attached here below, was proposed by Mariano Belaunde via personal mail: ************************************ Currently in a mapping operation or in an explicit object expression, if you do not indicate the extent, then by default the newly created object is automatically inserted to an inferred extent. We could imagine a different rule: in order for a created element to be inserted into an extent, make it explicit. Like in: mapping A::foo() : X@myextent { ... } x := object X@myextent { ... } We could also add a 'insertElement()' operation, in the cases where the inclusion to an extent has to be performed at a different time. ************************************ Thank you very much and sorry for any inconveniencies this might cause. Cheers!!! Victor Sanchez Open Canarias S.L. C/. Elías Ramos González, 4. Ofic. 304 38001 S/C de Tenerife - Spain Telf: +34 922 240 231 Date: Thu, 30 Apr 2009 13:26:52 -0430 Subject: [Issue 13103] From: Victor Sanchez To: qvt-rtf@omg.org Hello! It's been more than three months and I do not know if my previous mail sent about Issue 13103 was taken into account. I'd expect the following text to be appended to the contents of the issue: ************************************ Solution suggested by Mr. Mariano Belaunde: Currently in a mapping operation or in an explicit object expression, if you do not indicate the extent, then by default the newly created object is automatically inserted to an inferred extent. We could imagine a different rule: in order for a created element to be inserted into an extent, make it explicit. Like in: mapping A::foo() : X@myextent { ... } x := object X@myextent { ... } We could also add a 'insertElement()' operation, in the cases where the inclusion to an extent has to be performed at a different time. ************************************ Thanks in advance! Victor 2009/1/8 Victor Sanchez Hello, guys! It's Victor Sánchez, a colleague of Adolfo's in Open Canarias. I just wanted to point out that when I submitted QVT's Issue #13103 last year, I did not mention any suggestions to solve the stated problem. I don't know how to update that issue to include suggestion information. I'm afraid I cannot do that. The contents of the submitted issue follows: ************************************ In the Operational Mappings language, element creation and element attachment/detachment to/from an extent should be seen and treated as two different and independent activities. Once an element is created via an ObjectExp, this element is usually attached to another element immediately afterwards, which becomes its container, so the ObjectExp semantics of assigning it to an explicit or inferred extent becomes an unnecessary overhead. And also there are other times when we need to assign to an extent some model elements that may have been created at an unrelated time. They could even exist prior to the transformation execution. A case where this is relevant is with the result of a 'Element::clone()' or 'Element::deepclone()' operation execution. Is it expected that these model elements must belong by default to the same model as the original? How to clone parts of an extent with direction kind == 'in'? How to make them become part of the Set of root elements of another, different extent? ************************************ A possible solution, which is attached here below, was proposed by Mariano Belaunde via personal mail: ************************************ Currently in a mapping operation or in an explicit object expression, if you do not indicate the extent, then by default the newly created object is automatically inserted to an inferred extent. We could imagine a different rule: in order for a created element to be inserted into an extent, make it explicit. Like in: mapping A::foo() : X@myextent { ... } x := object X@myextent { ... } We could also add a 'insertElement()' operation, in the cases where the inclusion to an extent has to be performed at a different time. ************************************ Thank you very much and sorry for any inconveniencies this might cause. Cheers!!! Victor Sanchez Open Canarias S.L. C/. Elías Ramos González, 4. Ofic. 304 38001 S/C de Tenerife - Spain Telf: +34 922 240 231 Fax: +34 922 247 553