Xcore
If you often find yourself customizing the Ecore model with operations or redefining existing methods, you might want to try
Xcore for maintaining your Ecore model. Xcore is a DSL for Ecore. It is implemented in Xtext and Xbase, allowing you to specify the Ecore model with a Java-like syntax. Besides the structure of the model, you can also use Xcore to specify the behavior of operations, derived features, and provide custom implementation of methods. Moreover, the mapping of data types to Java types is more straightforward in Xcore. Being a DSL based on Xtext/Xbase, with Xcore you do not need a .genmodel
file to generate the Java code for your model; you just edit your file, and the Java code will be automatically generated on save.
In order to use Xcore, you need to install the feature "EMF - Eclipse Modeling Framework Xcore SDK" into your Eclipse, unless it is already installed.
In this section, we will implement a new Xtext DSL, for specifying libraries, books, and authors...