Xtext Tip: Some reasons to use a separated EMF model

In a previous tip I showed how to migrate from a generated EMF model to a manually maintained one. Turning something automatic to manual sounds completely counter intuitive. We should automate more, not the contrary. However, there are some good reasons to do this. Let’s explore them: Separation of concerns I see the grammar is a presentation artifact.

Continue Reading

Xtext Tip: Migrating to manual EMF model

Xtext is very good at inferring a metamodel from a grammar but it has its limitations. After reaching a certain complexity, I think it is important to decouple the grammar from the metamodel. This is allows to separate concerns: the metamodel becomes the “business model layer”, and the grammar becomes the “presentation layer”.

Continue Reading