Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » "Resolve Proxies" property
"Resolve Proxies" property [message #427623] Tue, 24 February 2009 17:12 Go to next message
Alex Boyko is currently offline Alex BoykoFriend
Messages: 200
Registered: July 2009
Senior Member
Hi,

What exactly does "Resolve Proxies" property mean for a reference?
I thought that this simply means that on a get call the object won't be
resolved automatically by EMF generated code and you have to resolve it
manually.
Recently, I heard a different interpretation of "Resolve Proxies".
If "Resolve Proxies" is false this means that the reference is never
expected to be a proxy. True means that proxy objects can be referenced.
Which one of these is true?
Thanks!

Cheers,
Alex
Re: "Resolve Proxies" property [message #427626 is a reply to message #427623] Tue, 24 February 2009 17:45 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33139
Registered: July 2009
Senior Member
Alex,

Comments below.


Alex Boyko wrote:
> Hi,
>
> What exactly does "Resolve Proxies" property mean for a reference?
Didn't you buy the EMF book? :-P
> I thought that this simply means that on a get call the object won't
> be resolved automatically by EMF generated code and you have to
> resolve it manually.
Yes, it definitely won't automatically be resolved.
> Recently, I heard a different interpretation of "Resolve Proxies".
> If "Resolve Proxies" is false this means that the reference is never
> expected to be a proxy. True means that proxy objects can be referenced.
> Which one of these is true?
They both sound true to me. If your expecting proxies you ought to have
generated logic for resolving them. Of course you can choose not to
have such logic though you could tell your clients that it's up to them
to resolve proxies, but that seems strange. So generally it's better to
think of a proxy resolving reference as one that supports cross document
references while references that don't support proxy resolution should
be thought of as being restricted to reside with the same resource.
> Thanks!
>
> Cheers,
> Alex
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: "Resolve Proxies" property [message #427664 is a reply to message #427626] Wed, 25 February 2009 15:15 Go to previous messageGo to next message
Chris McGee is currently offline Chris McGeeFriend
Messages: 99
Registered: July 2009
Member
Hi Ed,

One problem that we are noticing with this is that the resolveProxy()
mechanism in the ECrossReferenceAdapter doesn't work in the case where a
feature is set to resolveAll=false, is single valued, the value is a
proxy, and both resources are loaded. The reason for this is that the
call to setting.eGet(true) does not force the proxy to be resolved,
which is required in order for the reverse reference lookup to succeed
in finding this particular referencer.

Does this mean that the ECrossReferenceAdapter needs to be fixed? Or
perhaps is this an indication that EMF doesn't really support a feature
with resolveAll=false but at the same time have cross-resource
references? If so, maybe there should be some sort of a warning logged
when an EObject has a cross-resource reference in such a feature?

Thanks,
Chris
Re: "Resolve Proxies" property [message #427671 is a reply to message #427664] Wed, 25 February 2009 16:10 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33139
Registered: July 2009
Senior Member
Chris,

Comments below.

Chris McGee wrote:
> Hi Ed,
>
> One problem that we are noticing with this is that the resolveProxy()
> mechanism in the ECrossReferenceAdapter doesn't work in the case where
> a feature is set to resolveAll=false, is single valued, the value is a
> proxy, and both resources are loaded. The reason for this is that the
> call to setting.eGet(true) does not force the proxy to be resolved,
> which is required in order for the reverse reference lookup to succeed
> in finding this particular referencer.
When proxy resolve is off for a feature it really ought not to contain a
proxy and if it does you ought not to expect it to be resolve
automatically. Note also my comments about cross document references so
the fact that you're talking about "both resources" sound to me like a
case where proxy resolve ought to be true.
>
> Does this mean that the ECrossReferenceAdapter needs to be fixed? Or
> perhaps is this an indication that EMF doesn't really support a
> feature with resolveAll=false but at the same time have cross-resource
> references?
Yes I believe that's what I've said in my previous reply.
> If so, maybe there should be some sort of a warning logged when an
> EObject has a cross-resource reference in such a feature?
Some resource implementations (perhaps repository backed ones backed by
CDO) might not even use proxies so I'm not so sure about producing
warnings about it when validating.
>
> Thanks,
> Chris


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: "Resolve Proxies" property [message #427823 is a reply to message #427671] Mon, 02 March 2009 14:11 Go to previous messageGo to next message
Chris McGee is currently offline Chris McGeeFriend
Messages: 99
Registered: July 2009
Member
Hi Ed,

Thanks for the information.

Maybe this property should be renamed to avoid confusion? I was thinking
that there should be more emphasis on the proxy than on the resolution.
Something like "canContainProxies" perhaps?

Chris
Re: "Resolve Proxies" property [message #427825 is a reply to message #427823] Mon, 02 March 2009 14:33 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33139
Registered: July 2009
Senior Member
Chris,

Rename something that's been in its current form for 7 years and is
documented this way in the just-published book and refcard? There's an
idea! :-P


Chris McGee wrote:
> Hi Ed,
>
> Thanks for the information.
>
> Maybe this property should be renamed to avoid confusion? I was
> thinking that there should be more emphasis on the proxy than on the
> resolution. Something like "canContainProxies" perhaps?
>
> Chris


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: "Resolve Proxies" property [message #427827 is a reply to message #427825] Mon, 02 March 2009 14:42 Go to previous message
Chris McGee is currently offline Chris McGeeFriend
Messages: 99
Registered: July 2009
Member
True :-)

But I've seen this property misused about two or three times over the
years and often after the schema has been published and there's little
that can be done about it.

That's why I was thinking that a logged warning somewhere would help
someone to discover their mistake earlier. Of course, they should have
read the book but many do not take the time. :-)

Chris

Ed Merks wrote:
> Chris,
>
> Rename something that's been in its current form for 7 years and is
> documented this way in the just-published book and refcard? There's an
> idea! :-P
>
>
> Chris McGee wrote:
>> Hi Ed,
>>
>> Thanks for the information.
>>
>> Maybe this property should be renamed to avoid confusion? I was
>> thinking that there should be more emphasis on the proxy than on the
>> resolution. Something like "canContainProxies" perhaps?
>>
>> Chris
Previous Topic:Get the markup name associated with an EObject
Next Topic:User-friendly GUI to instantiate EMF classes
Goto Forum:
  


Current Time: Tue Apr 23 06:32:19 GMT 2024

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

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

Back to the top