How to dynamically extend and combine existing Ecore definitions without having to modify them?
EMF Facet, a new project we have proposed to create under EMFT, will propose dynamic extension mechanisms for all EMF-based tools exposing a view on a model:
- Navigation tools (browser, navigator, etc);
- Graphical modeling tools;
- Code or documentation generation (M2T) tools;
- Model-to-model transformation (M2M) tools.
Our proposition provides a solution to introduce new viewpoints (or "facets") on existing models:
- Extending an existing metamodel (Ecore model) in a non-intrusive way by adding new types, attributes, operations and relations. New relations could be used to compose several models by linking their elements.
- Computing an extension by executing queries against an existing model; queries will be implemented by making use of existing query mechanisms (e.g. considering Java, ATL, EMFQuery, Xpath, etc)
The Query "subClassifiers" visible as a "virtual" relation on Class
Some of these mechanisms have already been developped in the MoDisco project. But, as they could be reused by tools not related to software modernization (the scope of the MoDisco project), we have decided to contribute the corresponding components to EMF Facet.
In another post, I have also illustrated how Facets can be used to extend the Java metamodel to highlight JUnit concepts.