Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Resolve Proxies during linking phase
Resolve Proxies during linking phase [message #1312400] Thu, 24 April 2014 09:10 Go to next message
Norman Lenzner is currently offline Norman LenznerFriend
Messages: 4
Registered: April 2014
Junior Member
Hi,

we defined a DSL that supports a "templating" mechanism like:

TEMPLATE t
ATTRIBUTE a1
ATTRIBUTE a2

ENTITY e1 FROM t

ENTITY e2 FROM t

During the linking phase, our linker copies the "ATTRIBUTE"-elements from the templates to the entities and the code generators work on a model that was modified this way.
Now we have a problem, when template and entity are defined in different resources:
Resource r1 contains
TEMPLATE t
ATTRIBUTE a1
ATTRIBUTE a2

Resource r2 contains
ENTITY e1 FROM t

When the linker processes r2 the template t is a proxy object and we have no idea how to resolve this proxy to copy the attributes.
Is there any way to get the "ATTRIBUTE"-elements of t when linking r2?

regards
Norman
Re: Resolve Proxies during linking phase [message #1312742 is a reply to message #1312400] Thu, 24 April 2014 13:23 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

did you consider to use IDerivedStateComputer instead http://xtextcasts.org/episodes/18-model-optimization

or you copy the proxies to.


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Thu, 24 April 2014 13:23]

Report message to a moderator

Re: Resolve Proxies during linking phase [message #1312743 is a reply to message #1312400] Thu, 24 April 2014 13:22 Go to previous messageGo to next message
Holger Schill is currently offline Holger SchillFriend
Messages: 75
Registered: July 2009
Member
I am afraid that resolving crossrefs during linking is not a good Idea
since you may run into a chicken egg problem. Using the URI of the proxy
and try to resolve against the resources ResourceSet may lead to cycles.
Anyway - why don't you use a postprocessor after linking has been done.

Cheers,
Holger



On 24.04.14 14:50, Norman Lenzner wrote:
> Hi,
>
> we defined a DSL that supports a "templating" mechanism like:
>
> TEMPLATE t
> ATTRIBUTE a1
> ATTRIBUTE a2
>
> ENTITY e1 FROM t
>
> ENTITY e2 FROM t
>
> During the linking phase, our linker copies the "ATTRIBUTE"-elements
> from the templates to the entities and the code generators work on a
> model that was modified this way.
> Now we have a problem, when template and entity are defined in different
> resources:
> Resource r1 contains
> TEMPLATE t
> ATTRIBUTE a1
> ATTRIBUTE a2
>
> Resource r2 contains
> ENTITY e1 FROM t
>
> When the linker processes r2 the template t is a proxy object and we
> have no idea how to resolve this proxy to copy the attributes.
> Is there any way to get the "ATTRIBUTE"-elements of t when linking r2?
>
> regards
> Norman


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Re: Resolve Proxies during linking phase [message #1312752 is a reply to message #1312742] Thu, 24 April 2014 13:29 Go to previous messageGo to next message
Holger Schill is currently offline Holger SchillFriend
Messages: 75
Registered: July 2009
Member
Christian is absolutely right. Missed that one. ;-)

On 24.04.14 15:23, Christian Dietrich wrote:
> Hi,
>
> did you consider to use IDerivedStateComputer instead
> http://xtextcasts.org/episodes/18-model-optimization


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Re: Resolve Proxies during linking phase [message #1312904 is a reply to message #1312742] Thu, 24 April 2014 15:25 Go to previous message
Norman Lenzner is currently offline Norman LenznerFriend
Messages: 4
Registered: April 2014
Junior Member
Hi,

thanks for the link, it works Smile

Christian Dietrich wrote on Thu, 24 April 2014 09:23
Hi,

did you consider to use IDerivedStateComputer instead [link-not-allowed]

or you copy the proxies to.

Previous Topic:Typesystem for own DSL
Next Topic:Integrate xml into my dsl ('hidden' transformation)
Goto Forum:
  


Current Time: Thu Apr 18 08:02:53 GMT 2024

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

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

Back to the top