You need to extend
your models?
EMF Facet vs. EMF Profiles
Hugo Bruneliere [email protected]
Modeling Symposium – Monday March 26th, 2012
Philip Langer [email protected]
Modeling Language
Meta model
Concrete Syntax Editor
… generates Ruby on Rails.
… generates JavaServer Faces.
… generates DB Schema.
I want to additionally specify “Finder SQL” statements!
I want to additionally specify the bean scope!
Leave it as it is! If you introduce every
imaginable feature that I don’t need, I could have used
UML in the first place.
Why extending existing models?
Modeling Language
Meta model
Concrete Syntax Editor
… generates Ruby on Rails.
… generates JavaServer Faces.
… generates DB Schema.
I want to additionally specify “Finder SQL” statements!
I want to additionally specify the bean scope!
Leave it as it is! If you introduce every
imaginable feature that I don’t need, I could have used
UML in the first place.
You need a lightweight extension mechanism!
Main Objectives - No modification of existing models - Adding of “concern-specific” information
I can’t address all your requirements!
Why extending existing models?
EMF Facet - http://www.eclipse.org/modeling/emft/facet/
My instances (XMI)
conforms to
My model (in Ecore)
EMF Facet - http://www.eclipse.org/modeling/emft/facet/
My instances (XMI)
conforms to
My model (in Ecore)
Facet extends
My facet model • Types
• Attributes
• References
uses
Queries
Different languages • Java
• OCL
• Etc.
relies on
EMF Facet - http://www.eclipse.org/modeling/emft/facet/
My instances (XMI)
conforms to
My model (in Ecore)
Facet extends
My facet model • Types
• Attributes
• References
uses
Queries
Different languages • Java
• OCL
• Etc.
relies on
EMF Profiles - http://code.google.com/a/eclipselabs.org/p/emf-profiles/
My model (in Ecore)
Ecore metamodel
conforms to
EMF Profiles - http://code.google.com/a/eclipselabs.org/p/emf-profiles/
My model (in Ecore)
Ecore metamodel
conforms to
extends
My EMF Profile •Stereotypes
•Tagged Values
applied to
EMF Profiles - http://code.google.com/a/eclipselabs.org/p/emf-profiles/
My model (in Ecore)
Ecore metamodel
conforms to
extends
My EMF Profile •Stereotypes
•Tagged Values
applied to
My model & profile application
conforms to
Example for demo Review my model, Ms. “know-it-all”!
Example for demo Review my model, Ms. “know-it-all”!
• Without polluting the original instances!
• Without affecting the Ecore model!
• But still in a structured way!
• Easily processible by humans and tools!
Model Extension
EMF Facet EMF Profiles
Adding of new model elements
Annotating of existing model elements
Support for types, attributes, references
Support for types, attributes, references
Dynamically calculated (via model queries)
Statically defined (via model editors)
Customization of tree view
Customization of diagram view