EMF Facet is a new Eclipse Modeling Project lead by MIA-Software and with the collaboration of AtlanMod .
There is not yet much documentation available for the project (we are working on that) but as the project proposal stated , EMF Facet project aims to contribute a dynamic extension mechanism for EMF tools by introducing new viewpoints (or “facets”) on their underlying data (i.e. existing models). Examples of such extension mechanisms to “decorate” or “annotate” a EMF model could be:
- Extending an existing metamodel (Ecore model) in a non-intrusive way by adding new types, attributes, operations and relations.
- Computing an extension by executing queries against an existing model
- Virtualize the extension so that any EMF tool could use an extended model as a regular one.
Roughly speaking, you can think of EMF Facet as a kind of UML profile mechanism (though technically different) for EMF models, something that was missing until now. And yes, I know many people hate UML profiles but when properly used they are very very useful. UML profiles are not a replacement for DSLs (that would be the improper use) but they are useful nonetheless. And, in the same way we may want to (and can) annotate a UML model, we should be able to do the same with EMF models and EMF Facet is the project for that.
EMF Facet is just beginning so any feedback will be more than welcome.
ICREA Research Professor at Internet Interdisciplinary Institute (UOC). Leader of the SOM Research Lab focusing on the broad area of systems and software engineering. Home page.
UML profiles are not a replacement for DSLs (that would be the improper use)
What do you mean? Building (“internal”) DSLs is one of the main purposes I see for profiles and stereotypes (likewise for annotations in Java/C#). Otherwise, how can I build an entity modeling language or a web modeling on top of UML? Inheritance/interfaces can be cumbersome for that.
What I meant to say was that profiles are useful when you are just slightly extending the information of the model (e.g. indicating that a given attribute is a primary key), that is, when UML is a good base to express the concepts of your domain and you just want to complement it.
If the semantics of the constructs you need in your domain are too far from those offered by UML then profiles will not help you and it´s better to create your own DSL.
Right. My opinion is that between “slightly” and “too far” there is a significant area with various tones of grey, and in many cases UML will be a good host language for a DSL.
I am working on a project in which we provide a base metamodel that can be extended at run-time by third-party plugin developers (this is something close to what AMW provides with their base weaving metamodel). In this context, I am wondering whether EMF Facet is the right tool for managing this specific scenario and how then plugin developers may access the instances conforming to the extended metamodel (e.g., can they use them as input of Acceleo templates?).
I am looking for some basic tutorials about how to use EMF Facet in practice so that I can start answering the above mentioned doubts.
Do you have any useful pointer?
EMF Facet is a project originated from the Eclipse MoDisco one, so part of its documentation is still available from the MoDisco project documentation.
Looking to its official documentation in Eclipse Juno (http://help.eclipse.org/juno/index.jsp), you will find detailed explanations about how to create and use facets in the “MoDisco User Guide / Infrastructure / Facet Manager” section.
Directly related to this, I also encourage you to take a look to the generic querying system (cf. “MoDisco User Guide / Infrastructure / Query Manager” section).
I hope this helps.
Perfect! Thank you very much Hugo.