Skip to main content



      Home
Home » Modeling » TMF (Xtext) » resolving cross-references
resolving cross-references [message #984278] Wed, 14 November 2012 10:04 Go to next message
Eclipse UserFriend
Hi all,

When resolving a cross-reference in LinkingService.getLinkedObjects, I was returning an object retrieved with something like
resourceSet.getEObject(uri, true)
which caused the respective file to be opened and reparsed. I changed the second argument to "false" and so far it seems that it's still working (but there's a lot to test still).

Is the first way the right one, or it doesn't matter? Maybe I'm just not doing anything yet with the returned value?

best regards,
Vlad
Re: resolving cross-references [message #985741 is a reply to message #984278] Thu, 15 November 2012 16:51 Go to previous messageGo to next message
Eclipse UserFriend
resourceSet.getEObject(uri, false) will yield return null if the
resource is not yet loaded. In the default linking service, we use the
index and return a proxy rather than a resolved object. This will not
cause any files to be parsed. Have you tried that?


Am 14.11.12 16:04, schrieb Vlad Dumitrescu:
> Hi all,
>
> When resolving a cross-reference in LinkingService.getLinkedObjects, I
> was returning an object retrieved with something like
> resourceSet.getEObject(uri, true) which caused the respective file to be
> opened and reparsed. I changed the second argument to "false" and so far
> it seems that it's still working (but there's a lot to test still).
>
> Is the first way the right one, or it doesn't matter? Maybe I'm just not
> doing anything yet with the returned value?
>
> best regards,
> Vlad
>


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Re: resolving cross-references [message #985746 is a reply to message #985741] Thu, 15 November 2012 17:42 Go to previous messageGo to next message
Eclipse UserFriend
Thanks Jan,

I another thread, I described that if I put all referenceable objects in the index this blows up the JVM's memory. There could be 3000 largish files in a project. So I got the suggestion to just keep the top-level constructs in the index, and then navigate the model. This obviously requires the objects to be resolved, but I thought they would be retrieved from a serialized form instead of from parsing the file again. This is how I did in my pre-Xtext implementation and took it for granted.

I understand your explanation that I got it working with a 'false' argument just by accident. Thanks!

regards,
Vlad
Re: resolving cross-references [message #985938 is a reply to message #985746] Fri, 16 November 2012 13:05 Go to previous messageGo to next message
Eclipse UserFriend
A customer of ours used EMF proxies with some essential values set.
These can be populated e.g. from the userData in the
IEObjectDescriptions. After all proxies are EObjects and behave to a
certain extend like those. Even though I would not recommend this as
long as you are 100% sure what you're doing, this might be something to
look at.

Am 15.11.12 23:42, schrieb Vlad Dumitrescu:
> Thanks Jan,
>
> I another thread, I described that if I put all referenceable objects in
> the index this blows up the JVM's memory. There could be 3000 largish
> files in a project. So I got the suggestion to just keep the top-level
> constructs in the index, and then navigate the model. This obviously
> requires the objects to be resolved, but I thought they would be
> retrieved from a serialized form instead of from parsing the file again.
> This is how I did in my pre-Xtext implementation and took it for granted.
>
> I understand your explanation that I got it working with a 'false'
> argument just by accident. Thanks!
>
> regards,
> Vlad
>


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Re: resolving cross-references [message #985953 is a reply to message #985938] Fri, 16 November 2012 15:54 Go to previous message
Eclipse UserFriend
I'm not sure I understand what you mean -- the language model classes use proxies instead of normal references?

That might be interesting to explore, but there's one more thing that I'm unsure about and that is whether I know what I'm doing Smile

best regards,
Vlad
Previous Topic:importing native java source code
Next Topic:Selection for a type system
Goto Forum:
  


Current Time: Wed Jul 23 04:20:40 EDT 2025

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

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

Back to the top