Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [EMF.core] EcoreUtils.resolve() do not return the actual instance
[EMF.core] EcoreUtils.resolve() do not return the actual instance [message #717206] Fri, 19 August 2011 15:29 Go to next message
simon.vivien is currently offline simon.vivienFriend
Messages: 21
Registered: August 2011
Junior Member
Hi,

I am currently trying to resolve proxies with the EcoreUtils.resolve() method, but the returned object is a copy of the original object.

I am wondering if there is any way to retrieve the orginal object or not.


Thanks,

Simon.
Re: [EMF.core] EcoreUtils.resolve() do not return the actual instance [message #717230 is a reply to message #717206] Fri, 19 August 2011 16:17 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Simon,

What exactly do you mean by "the original object"? Resolving a proxy
involves searching the resource set for a resource with the proxy's URI
and then resolving the fragment of the URI within that resource. If
there exists an object in the resource set already, that one will be
returned. Otherwise a resource will be loaded into the resource set.
Given there can be an arbitrary number of resource sets in your JVM, you
can have an arbitrary number of copies of anything, none of which is
special in a way that you wold call it "the original" version.


On 19/08/2011 8:29 AM, simon.vivien wrote:
> Hi,
>
> I am currently trying to resolve proxies with the EcoreUtils.resolve()
> method, but the returned object is a copy of the original object.
>
> I am wondering if there is any way to retrieve the orginal object or not.
>
>
> Thanks,
>
> Simon.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: [EMF.core] EcoreUtils.resolve() do not return the actual instance [message #717725 is a reply to message #717230] Mon, 22 August 2011 07:44 Go to previous messageGo to next message
simon.vivien is currently offline simon.vivienFriend
Messages: 21
Registered: August 2011
Junior Member
It effectively make sense.

Thanks
Re: [EMF.core] EcoreUtils.resolve() do not return the actual instance [message #717768 is a reply to message #717725] Mon, 22 August 2011 09:34 Go to previous messageGo to next message
simon.vivien is currently offline simon.vivienFriend
Messages: 21
Registered: August 2011
Junior Member
Hi again,

In my case, it doesn't matter since the EObject represented by the proxies I resolve have a EAttribute with ID property set to true, but if they were NOT, how can it be possible to compare the instance returned by the proxy resolution with the object the proxy is supposed to represent ?

Simon
Re: [EMF.core] EcoreUtils.resolve() do not return the actual instance [message #717830 is a reply to message #717768] Mon, 22 August 2011 13:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Rich Kulp

While it is a proxy eProxy() returns true. When it is resolved the proxy
is physically replaced with the resolved copy and eProxy() will return
false.


--
Thanks,
Rich Kulp
Re: [EMF.core] EcoreUtils.resolve() do not return the actual instance [message #717871 is a reply to message #717768] Mon, 22 August 2011 14:51 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Simon,

Comments below.

On 22/08/2011 2:34 AM, simon.vivien wrote:
> Hi again,
>
> In my case, it doesn't matter since the EObject represented by the
> proxies I resolve have a EAttribute with ID property set to true,
Certainly it will be possible for there to be multiple objects with the
same ID, though they'll need to be contained by different resources. So
having the same ID won't make them identical.
> but if they were NOT, how can it be possible to compare the instance
> returned by the proxy resolution with the object the proxy is supposed
> to represent ?
Define what you mean by "the object the proxy is supposed to
represent". If you have a resource set in your JVM already containing
the exact objects you want to reuse, you ought to be loading all your
resources in that resource set.
>
> Simon


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Problem regarding resolving proxy of cross model reference
Next Topic:ECore diagram reference creation
Goto Forum:
  


Current Time: Fri Apr 26 13:37:28 GMT 2024

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

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

Back to the top