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 05:10 Go to next message
Norman Lenzner is currently offline Norman Lenzner
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 09:23 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6233
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.

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

Report message to a moderator

Re: Resolve Proxies during linking phase [message #1312743 is a reply to message #1312400] Thu, 24 April 2014 09:22 Go to previous messageGo to next message
Holger Schill is currently offline Holger Schill
Messages: 68
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 09:29 Go to previous messageGo to next message
Holger Schill is currently offline Holger Schill
Messages: 68
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 11:25 Go to previous message
Norman Lenzner is currently offline Norman Lenzner
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: Sat Aug 30 22:38:20 EDT 2014

Powered by FUDForum. Page generated in 0.01725 seconds