Sunday, June 21, 2009

Synchronized editors with TMF/Xtext and GMF

Well, here it is, the screencast showing a textual TMF/Xtext and a graphical GMF editor synchronized on the same model.


The example has been implemented with only a few changes to generated code: In Xtext, the following modifications were applied:


  • A Formatter to define where to use what kind of whitespace, when the textual representation is derived from the semantic model.
  • An IFragmentProvider that generates name-based fragments (IDs) for elements in an Xtext resource. That way, the correspondence of graphical nodes to semantic elements is preserved even if you delete a preceeding entity.
  • An AbstractEntitiesJavaValidator has been implemented for Java based validation

On the GMF side:

  • In the mapping model, I had to use feature initializers to make sure names are initialized properly on creation, to always have serializable models.
  • In the generator model, I had to manually set the domain genmodel and the file extension.
  • In the generator model, I enabled validation decorators and printing, and added the plug-in de.itemis.gmf.runtime.extensions from the GMFTools project containing a more sophisticated layout.


Additionally, I added a bit of glue code:

  • An action to navigate from an EditPart to the textual representation, using Xtext's NodeAdapter.
  • A listener that warns the user if (s)he's about to change a file that has already been changed in another dirty editor, and allows to abandon the changes.


The editor are synchronizing on save, to avoid GMF's canonical edit policies pruning nodes/edges belonging to temporarily lost elements.

Xtext plays well with EMF. It registers

  • A resource factory for a specific XtextResource implementation that encapsulates the parser (text->model) as well as the serializer (model->text).
  • An EValidator with a declarative Java implementation

Friday, June 19, 2009

Slides from Xtext Workshop at Code Generation 2009

Code Generation 2009 has been a lot of fun. Yesterday, Moritz, Sebastian and me gave a hands-on workshop on Xtext. Participants seemed to like it and we could even convince Steven Kelly from Metacase to give it a try. I've uploaded the slides to slideshare, so if you wish to learn something about Xtext, you can have a look at it here.

Back to Kiel, we are now sweating to give Xtext the last polish before it is released with Galileo.

Tuesday, June 16, 2009

CodeGeneration 2009

I am back at Cambridge (UK) for this year's Code Generation conference.

The itemis-Kiel team already arrived yesterday, and after a nice walk through the town and some fish and chips, I finished a showcase with a GMF editor on an Xtext model. So be prepared for another converging editors screencast soon :-)

The conference started this morning. Up to now, I have heard two talks: First, Kathleen Dollard from AppVenture talked about Template Specialization. Kathleen referred to the .NET code generation languages and their specific problems, e.g. with respect to modularity and extensibility. To me it looked like we've got more comfortable solutions in the Eclipse/Java world. Then, Sven and Sebastian talked about Challenges in DSL Design. They elaborated that todays external DSLs usually stop at modeling behavior because of the lack of an embeddable expression language. Looks like that's going to be one of the goals in the next version of Xtext. Right now I am guarding the itemis booth for a while, just to join the case study by Karsten and Heiko on their MDSD projects at Deutsche Börse AG.

Despite all prejudice against British food, catering is excellent. Thanks to the perfect organisation by Mark Dalgarno and Andy Moorley, we're going on a traditional punting trip along the river Cam tonight. Should I have brought my wetsuit?

Thursday, April 30, 2009

JAX is over, now head for Code Generation


The JAX 2009 conference in Mainz (Germany) was once again big fun: A good opportunity to meet lots of intriguing people and listen to entertaining and informative talks in a beautiful location at the river Rhine. I've just uploaded the slides of the talks I gave, so if you're interested, have a look at EMF - Beyond the Basic or Eclipse Modeling Overview.



If you're keen on modelling with double 'l' :-), I recommend to join the upcoming CodeGeneration 2009 in Cambridge (UK), 16th-18th June 2009. Next to a bunch of well known speakers from industry and research, my colleagues from itemis and me are also going to have our share on the programme, e.g. Challenges in DSL Design, Mastering differentiated MDSD requirements at Deutsche Boerse AG, MDD: The Good, The Bad and The Ugly, MDD: The Best, The Worst and The Ugliest, Language Definition, Extension and Composition with MPS and an Xtext Workshop.

Friday, April 17, 2009

Talks at JAX Conference in Germany


Sven and me, we're going to give some talks on Eclipse Modeling, DSLs and Xtext at the JAX conference in Mainz (Germany) next week:

Eclipse Modeling - Overview
Sven Efftinge, Jan Köhnlein
Tue 21/04/2009, 10:00-11:15h

Code generation in agile Projects
Sven Efftinge, Jan Köhnlein
Tue 21/04/2009, 16:45-17:45h

Xtext
Sven Efftinge
Wed 22/04/2009, 10:15-11:15h

EMF: Beyond the Basics
Jan Köhnlein
Wed 22/04/2009, 16:15-17:15h

Hope to see you there!

Tuesday, March 24, 2009

Xtext, Generic Editor and EMF Index at EclipseCon

Just finished our talks at EclipseCon.

First, Sven and me talked about the new TMF/Xtext. The room was so crowded that some listeners even had to sit on the floor. Presenting was really fun and given the feedback people are really excited for Xtext. So we are, even though Sven has a bad throat and almost lost his voice ;-)

Given the good resonance, we're trying to organize a BoF session on Xtext tomorrow. Stay tuned for exact time and location.

Sven had a 10 minutes talk on the Generic EMF Editor then, and showed the Editor, Xtend and Xpand. I think, it's a good idea to point people at the fancy features of the oAW languages, such as polymorphic dispatch and higher-order functions.

Finally, I gave a 10 minutes talk on EMF Index. I have the impression people were quite curious about that topic as we already mentioned that in our Xtext talk. I tried to prepare the slides in the presentation zen style, and I can just conclude that presenting is so much more fun than having a clutter of bullet pointed list. I hope, it's the same for the viewers. And I exactly hit the 10 mins :-)

EclipseCon is really great. You really meet lots of people in person you have only known from blogs or mailing lists. Having had my share, I can now relax and join the other talks on so many other interesting topics.

Tuesday, March 10, 2009

EMF Index Creation Review

Tomorrow will be the creation review for the new EMFT subproject EMF Index. I am really looking forward to my first Eclipse project leadership and I hope everything will work out fine at the review.

EMF Index aims at indexing EMF models to allow scalable modeling tools with JDT-like comfort. So, if you have any objections against EMF Index, speak now (in the EMFT newsgroup) or remain silent forever ;-)

I am also glad to have the opportunity to present EMF Index at EclipseCon 2009 in Santa Clara. Looks like many of the interested parties will attend. I am going to give another talk together with Sven on Next generation textual DSLs with Xtext. It's also my first trip to the US, which makes me even more excited.