BT

Using Xbase to Define a Generic Graphical View

by Jean-Jacques Dubray on Jun 29, 2011 |

Xbase is a new component of Xtext. Sven Efftinge who created it explained last year:

Xbase is a partial programming language implemented in Xtext and is meant to be embedded and extended within other programming languages and domain-specific languages (DSL) written in Xtext.

DSLs often need to express some basic behavior which can be combersome when done in a pure declarative way. This has clearly been one of the shortcomings of external DSLs vs internal DSLs. Xbase was designed to fill that gap. However, Xbase was also designed with the Java developer in mind and the (partial) language binds to the JVM. Xbase is statically types, supports generics ... and closures and type inferences. In Xbase, everything is an expression: everything returns something.

Last week, Jan Koehnlein, a core committer of Xtext, and software architect at ITemis, showed how Xbase could be used to rapidly create graphical representations of a model.

Most graphics frameworks in the Eclipse ecosystem provide graphical editors. Usually, the semantic model is mapped to its graphical representation using a hard wired transformation, be it in code (GEF, Graphiti) or in models and a code generator (GMF, the upcoming Spray project).

He created two Xtext 2.0 DSLs which use Xbase. As Xbase is using the Java typesystem, it is easy to navigate the model to create the graphical view. The graphics are implemented using plain GEF and Zest layouts (the Eclipse Visualization Toolkit).

Generic graph views configured with Xtext DSLs from Xtext Team on Vimeo.

Do you see Xbase filling an important gap in external DSLs? Do you plan on using Xbase for your MDSD projects?

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2014 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT