|Re: [QVTO] Cloning intermediate class objects [message #859059 is a reply to message #859013]
||Fri, 27 April 2012 12:35
| Ed Willink
Registered: July 2009
The weasel answer: The OMG specification is informal and uses vague
terminology such as sub-objects. In OCL 2.0, upon which QVT 1.0 and 1.1
is based, collections are not objects, so it could be argued that they
do not need copying. In OCL 2.2 Collections are Objects but collections
do not contain their content.
Pragmatically, intuitively sensible behaviour does not seem to be
satisfied. Please raise a QVTo bug.
On 27/04/2012 13:09, Christopher G. wrote:
> I have an intermediate class within my transformation. Instances of
> that class refer to an OrderedSet of another type. Now, I need to
> perform a deepclone on such an intermediate class object.
> I think that in general, intermediate classes lack a concept for
> cloning since their references do not distinguish between containments
> and non-containments. At runtime, all references seem to be treated as
> non-containments, which IMO implies that 'clone' and 'deepclone' have
> an equivalent behavior for intermediate classes.
> Albeit, when I call clone or deepclone on an instance of my
> intermediate class, the cloned object refers to the same(!) OrderedSet
> as the original. Hence, modifying the OrderedSet within the original
> affects the clone and vice versa.
> Normally, cloning objects with 0..* non-containments involves a new
> individual(!) sequence (OrderedSet in my case) that refers to the same
> objects as the original one. Why does my clone refer to the same
Powered by FUDForum
. Page generated in 0.01742 seconds