Differences in URI values [message #1751843] |
Mon, 16 January 2017 07:39 |
chris yo Messages: 146 Registered: February 2013 |
Senior Member |
|
|
I want to get the URI of my data.
So, I have this object called x.
I noticed that I can get the URI in different ways.
[1] x.eContainingFeature.eContainer.eResource.URI
[2] x.eResource.URI
[3] x.eContainer.eResource.URI
What are the differences of these 3 URI values? Should I expect them to always contain the same values?
[Updated on: Mon, 16 January 2017 07:40] Report message to a moderator
|
|
|
|
|
Re: Differences in URI values [message #1751847 is a reply to message #1751846] |
Mon, 16 January 2017 08:06 |
|
an easy analogy would be the terms classes and objects/instances
in emf lets say there is a class Person that has/owns an Adress what has an Attribute name
you have a Person "Hugo" that lives at "AStreet".
having the "AStreet" in hand "eContainer" will gives you "Hugo"
but eContainingFeature will give you "Field adress of Type Adress of Class Person"
i recommend some basic reading on EMF
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
|
|
|
|
|
|
|
|
Re: Differences in URI values [message #1752029 is a reply to message #1752025] |
Wed, 18 January 2017 03:45 |
Ed Merks Messages: 33216 Registered: July 2009 |
Senior Member |
|
|
No, this isn't a safe general assumption. The first is the feature of the container of x that actually contains x, i.e., you could call x.eContainer.eGet(x.eContainingFeature) and expect to find x in the result. The second is the feature that contains the container of x. They might be the same feature, but generally not because generally the container will have a completely different set of features because it's a completely different class of object.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.04577 seconds