Re: copy of JMI extents
Martin Matula <[email protected]>
| Newsgroups | gmane.comp.java.netbeans.modules.mdr.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Holger,
Holger Krug wrote:
> Really: copying cyclic references via read-only attributes would not
> be possible. But that is not a problem: they cannot be copied, because
> they cannot be set. But if they cannot be set, they never will be
> there, hence no need to copy them ;-)
That's right. Forget about my previous remarks about composition semantics.
> Your remarks make me follow this approach: Whenever I have to create a
> target object, I will create it with all attributes given. Whenever a
> source attribute value to be copied is or contains source objects, I
> will copy them first. Whenever I detect a cycle, I will report an
> error "cyclic attribute references not allowed by future MOF version".
Yes, this is how our XMIWriter does it (except the error - you should
rather throw somethink like UnexpectedError/Exception("Invalid cyclic
attribute references.") As you pointed out, this can never occur so the
exception will be there just to make sure.
Martin