-
Notifications
You must be signed in to change notification settings - Fork 2
0. Concept
The idea behind the ecorification is to decorate Java code with the functionality of model code generated from Ecore metamodels. To achieve this, the Java code will be interlaced with the generated model code of an Ecore metamodel that was extracted from the original Java code. The model code and the original code will be connected with wrapper classes.
After the ecorification we distinguish Java code from three different sources:
- Legacy code: Describes the edited classes of the original Java code.
- Ecore code: Describes the Java code that was generated from the Ecore metamodel that was extracted from the original code.
- Wrapper code: Describes the Java code that is used to connect the legacy code and the Ecore code
To ecorify Java code, an Ecore metamodel will be extracted from the original code. The metamodel is then used to generate the Ecore code. For every class in the original code, there is now an interface and a class inheriting from EObject
in the Ecore code. Then, the wrapper code will be generated. For every class in the original code, there will be a wrapper class that implements the correlating interface in the Ecore code. It delegates all Ecore functionality to the correlating implementation class in the Ecore code. The original classes will now be edited to inherit from the correlating wrapper classes. These classes form the legacy code.
The ecorification is depicted for one class in the following diagram: