Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [Xtend2] Builder Pattern: Cross References
[Xtend2] Builder Pattern: Cross References [message #757885] Fri, 18 November 2011 12:26 Go to next message
Hauke Fuhrmann is currently offline Hauke FuhrmannFriend
Messages: 333
Registered: July 2009
Senior Member
Hi there,

I love the new Xtend2 Builder Pattern that you can use since the new
Closure syntax in Xtend as presented by Sven

This allows to create containment trees of elements very elegantly like
Sven shows in the HTML example.

Is there a good solution how to integrate cross references between the
elements also beautifully? I only came up with something like this:


where the connect function uses eContainer to search the containment
hierarchy for nodes with the corresponding names. This seems to be
rather brittle as it will notice only at runtime that a corresponding
element is not there.

As crossreferences may be a very common case, maybe there is a generic
solution to that? Maybe like giving results of the closures a name or
something such that you can address closure elements from other
elements? Hmm... dunno, seems to not match the idea of a closure. Any ideas?

Re: [Xtend2] Builder Pattern: Cross References [message #758068 is a reply to message #757885] Mon, 21 November 2011 20:32 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13761
Registered: July 2009
Senior Member

what about using create extensions? you call them n times with the same parameter and will always get the same instance


Need professional support for Xtext, Xpand, EMF?
Go to:
Twitter : @chrdietrich
Blog :
Previous Topic:How i load resources dynamically
Next Topic:getting rid of warning "Disabling JDT..."?
Goto Forum:

Current Time: Tue Mar 02 21:40:35 GMT 2021

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

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

Back to the top