| EList reference composition [message #429842] |
Mon, 04 May 2009 15:27  |
Eclipse User |
|
|
|
Hello everyone,
It has been my experience with individual objects designated with
"containment=false" that if the object is provided an item from the same
model/resource, than the serialization of the item's reference is composed
of simply the fragment part of the item's URI, such as:
attr="//@rootNode/@child[key='item5']/@child[key='item7']"
When I add the same item to an EList object in the same model that is
designated with "containment=false", however, I see that the full reference
appears in the serialization, such as:
href=../../../user/temp/model/test.ml#//@rootNode/@child[key ='item5']/@child[key='item7']
In short, is this to be expected? Do referencing EList objects always
serialize a full reference, even if the object being added to the list is
part of the same model?
There are several useful qualities of the "fragment only" aspect of
serializing references to items in the same model... reduction in model
size, speed of model load, independence of physical model position, etc.;
would be a shame if these advantages were lost in employing ELists...
Thanks for any feedback on this,
-Pete
|
|
|
| Re: EList reference composition [message #429845 is a reply to message #429842] |
Mon, 04 May 2009 15:40   |
Eclipse User |
|
|
|
Pete,
Comments below.
Pete Ellis wrote:
> Hello everyone,
>
> It has been my experience with individual objects designated with
> "containment=false" that if the object is provided an item from the same
> model/resource, than the serialization of the item's reference is composed
> of simply the fragment part of the item's URI, such as:
>
> attr="//@rootNode/@child[key='item5']/@child[key='item7']"
>
Yes, what I'd call an IDREF. I.e., in particular there is no "#" to
indicate that it is a URI...
> When I add the same item to an EList object in the same model that is
> designated with "containment=false", however, I see that the full reference
> appears in the serialization, such as:
>
> href=../../../user/temp/model/test.ml#//@rootNode/@child[key ='item5']/@child[key='item7']
>
In this case it's in another resource, so yes, the resource needs to be
specified and the fragment within that resource.
> In short, is this to be expected?
Yes.
> Do referencing EList objects always
> serialize a full reference, even if the object being added to the list is
> part of the same model?
>
It doesn't care about models. It cares about which resource. A
reference is cross resource or same resource. In the later case, the
resource's URI must be specified...
> There are several useful qualities of the "fragment only" aspect of
> serializing references to items in the same model... reduction in model
> size, speed of model load, independence of physical model position, etc.;
> would be a shame if these advantages were lost in employing ELists...
>
It has nothing to do with lists either. Single valued features will
have the same variation.
> Thanks for any feedback on this,
>
In XML Schema, IDREF can be used only to refer to things in the same XML
tree/resource/file. You need an anyURI to refer to things in other
resources. That's all that's at play here...
> -Pete
>
>
>
|
|
|
|
|
|
|
| Re: EList reference composition [message #429899 is a reply to message #429850] |
Wed, 06 May 2009 09:59  |
Eclipse User |
|
|
|
On second look, I am mistaken! Non-containment ELists certainly persist
IDREF references to same-resource items... the URI references I am seeing
have snuck into the models I am dealing with as the result of some inproper
handling/adjustment of references that emerge after performing
EcoreUtil.copy() operations - I never corrected the item references to look
at components in the local resource that the copy was being placed into.
Sorry for the false alarm - oh how I wish my newgroup tool allowed editing
of past posts...
Thanks all, -Pete
|
|
|
Powered by
FUDForum. Page generated in 0.05124 seconds