Skip to main content



      Home
Home » Modeling » EMF » EList reference composition
EList reference composition [message #429842] Mon, 04 May 2009 15:27 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 #429846 is a reply to message #429845] Mon, 04 May 2009 15:49 Go to previous messageGo to next message
Eclipse UserFriend
Ed,

Many thanks for the response - a quick follow up just to be clear: If I add
a "same resource" item to an EList, can I expect an IDREF for that item to
appear in the serialization of the EList?

Thanks, -Pete
Re: EList reference composition [message #429849 is a reply to message #429846] Mon, 04 May 2009 16:25 Go to previous messageGo to next message
Eclipse UserFriend
Pete,

Best to test and verify. :-P


Pete Ellis wrote:
> Ed,
>
> Many thanks for the response - a quick follow up just to be clear: If I add
> a "same resource" item to an EList, can I expect an IDREF for that item to
> appear in the serialization of the EList?
>
> Thanks, -Pete
>
>
>
>
>
>
Re: EList reference composition [message #429850 is a reply to message #429849] Mon, 04 May 2009 17:12 Go to previous messageGo to next message
Eclipse UserFriend
Rats... on a first look, it does appear that non-containment EList
references to same-resource items are serialized with the full URI (not just
the IDREF).

I'll continue to look into this. If anyone knows of a
fix/work-around/setting-change that will alter this behavior, I'd be
interested!

Thanks,
-Pete
Re: EList reference composition [message #429852 is a reply to message #429850] Mon, 04 May 2009 17:55 Go to previous messageGo to next message
Eclipse UserFriend
Pete,

Keep in mind the recurring advice I give time and time again: be sure
the URI of each resource is absolute, i.e, that it include the full
scheme/protocol and all the rest.


Pete Ellis wrote:
> Rats... on a first look, it does appear that non-containment EList
> references to same-resource items are serialized with the full URI (not just
> the IDREF).
>
> I'll continue to look into this. If anyone knows of a
> fix/work-around/setting-change that will alter this behavior, I'd be
> interested!
>
> Thanks,
> -Pete
>
>
>
Re: EList reference composition [message #429899 is a reply to message #429850] Wed, 06 May 2009 09:59 Go to previous message
Eclipse UserFriend
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
Previous Topic:New/Reload a .genmodel
Next Topic:Problem with databinding to an attribute of type java.lang.Object
Goto Forum:
  


Current Time: Sun Nov 09 17:19:31 EST 2025

Powered by FUDForum. Page generated in 0.05124 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top