[email protected]Department of Telecooperation Johannes Kepler University Linz Altenberger Straße 69 4040 Linz, Austria From UML Profiles to EMF Profiles and Beyond 49th International Conference on Objects, Models, Components and Patterns Zurich, Switzerland, 29 June 2011 Philip Langer, Konrad Wieland, Manuel Wimmer, and Jordi Cabot Philip Langer
31
Embed
From UML Profiles to EMF Profiles and Beyond (TOOLS'11)
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
[email protected] of TelecooperationJohannes Kepler University LinzAltenberger Straße 694040 Linz, Austria
From UML Profiles to EMF Profiles and Beyond
49th International Conference on Objects, Models, Components and PatternsZurich, Switzerland, 29 June 2011
Philip Langer, Konrad Wieland, Manuel Wimmer, and Jordi Cabot
Philip Langer
Overall Goal of This Work
2
UML Profiles: A Short Introduction Lightweight Language Extension Mechanism of the UML A Profile consists of Stereotypes Stereotypes extend base classes
And may introduce “tagged values”
Profiles are applied to UML models By applying stereotypes to instances of their base classes Specifying concrete values for their defined “tagged values”
“Adopt the notion of UML Profiles to DSMLs residing in EMF”
UML Profiles: A Short Introduction
3
Profile specification
Profile application
«profile» EJB
«enumeration»StateKind
statelessstateful
UserModel
«apply»
«SessionBean»Customer state=stateless
Component«stereotype»
Bean
«stereotype»EntityBean
«stereotype»SessionBean
state: StateKind
«metaclass»
Motivation
Overall goal “Adopt the notion of UML Profiles to DSMLs residing in EMF”
Is combination of profiles with DSMLs a contradiction? Many debates on Pros and Cons of adopting UML Profiles or DSMLs
4
UML Profiles vs DSMLs
5
Reuse UML’s language concepts and existing UML editors!
Create a lean language that is straight to the point!
You’ll end up with an overloaded and imprecise language!
You’ll have to create the whole infrastructure by yourself!
UML Profiles vs DSMLs
6
These debates concern adopting eitherUML Profiles or DSMLs
for creating new languages.
What aboutextending existing languages?
It’s your language…just extend your metamodel.
Motivating Scenario
7
Data Modeling Language
Metamodel
ConcreteSyntax Editor
… generates Ruby on Rails.
… generates JavaServer Faces.
… generates DB Schema.
I want to additionally specify“Finder SQL” statements!
I want to additionally specifythe 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.
Motivating Scenario
8
Data Modeling Language
Metamodel
ConcreteSyntax Editor
… generates Ruby on Rails.
… generates JavaServer Faces.
… generates DB Schema.
I want to additionally specify“Finder SQL” statements!
I want to additionally specifythe 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 lightweightextension mechanism: Profiles!
Other scenarios- No influence on the metamodel- “Concern-specific” annotations
I can’t address all your requirements!
Benefits of Profiles for DSMLs
Lightweight language extension Introduce additional features No need for changing the metamodel and the modeling infrastructure
Dynamic model extension Existing models can be extended; even by multiple profiles and stereotypes Profile applications are separated from the models ( no model pollution)
Preventing metamodel pollution Metamodels represent only information coming from the modeling domain Concern-specific information is defined in a profile
Model-based representation Profile applications are well-defined ( they can be validated) Profile applications are just additional models ( reuse existing frameworks)
9
The Challenge
10
Okay, so let’s use profiles!
But wait, that’s not so easy with EMF!
M3
UMLCore Profiles
«import»
M2
M1
UML aProfile
«instanceOf» «instanceOf»
«instanceOf» «instanceOf»
aUMLModel
aProfileApplication
«extend»
«extend»
EMF
Ecore
Profile MM
«instanceOf»
aProfile
«instanceOf»
aProfileApplication
«instanceOf»
A Solution*: Metalevel Lifting by Inheritance
11* In the paper, we discuss an alternative solution as well.
A Profile Application: ProfileApplication: SessionBean
name=“Entity”
: EntityappliedTo
stereotypeApplications
stereotypeApplicationsisStateful=true
«instanceOf» «instanceOf»
«instanceOf»
«import»
«instanceOf»
M3 M3 M2
M2
M2
M1 M1
M1/2
M2/3
«instanceOf»
«instanceOf»
M1
Example: EJB Profile Specification
20
Example: EJB Profile Application
21
From UML Profiles to EMF Profiles and Beyond
UML Profiles can be specified for UML only No need for further reuse of profiles for other languages
EMF Profiles can be specified for every Ecore-based language Reuse a profile for more than one language
Generic Profiles Reuse a profile for several “user-selected” DSMLs
Meta Profiles Reuse a profile for all DSMLs
22
Generic Profiles
Reuse a profile for several “user-selected” DSMLs Extend generic types instead of concrete types Bind generic types to concrete types to apply a profile Use OCL to further restrict valid bindings
All graphics of characters of “The Simpsons” are downloaded from http://www.simpsoncrazy.com
Backup Slides
28
Related Work
Weaving Models Powerful mechanism for annotating models However, they are counter-intuitive and not intended to be used by “users” Not possible to annotate models in concrete syntax
Kolovos et al.: Model Decorations Additional information is saved in GMF’s notes (text fragments) Transformations to inject and extract models from these text notes Only supports annotating GMF Forces users to create hand-crafted transformations Users have no feedback whether the text in notes is valid
Bruneliere et al: EMF Facet Allows to define additional derived classes and features Derived information is transient Complementary to EMF Profiles we plan to integrate EMF Profiles to EMF Facet
Clark et al: Meta packages Allows to extend the language XCore EMF Profiles is more generic because any Ecore-based language can be extended