Re: copy of JMI extents
Holger Krug <[email protected]>
| Newsgroups | gmane.comp.java.netbeans.modules.mdr.devel |
|---|---|
| Message-ID | <[email protected]> |
On Tue, Aug 06, 2002 at 04:55:26PM +0200, Martin Matula wrote:
> 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
No, in my implementation it can appear, and your previous comments
were correct:
It cannot appear for read-only attributes, but it can appear for
read-write attributes. But I'm really to lazy to make this distinction
right now in my implementation. Hence cyclic references in read-write
attributes will bring my implementation down, at least for the moment.
So it would be really fine to forward your proposal to the MOF team,
wouldn't it ?
--
Holger Krug
[email protected]