automatically bridging uml profiles into mof metamodels
TRANSCRIPT
Ivano Malavolta Gran Sasso Science Institute Henry Muccini University of L’Aquila
Marco Sebastiani University of L’Aquila
Automatically bridging UML profiles to MOF metamodels
Funchal, 27th August 2015
Background
Domain-specific applications require notations to capture the domain’s specificities [1,2,3]
Domain-specific languages
• metamodel for abstract syntax • set of concrete syntaxes
Examples:
+ concise language - additional training - tools to be developed
DSMLs
Light-weight extension of UML via profiles Examples: + reuse of knowledge about UML + reuse of UML-based editors - ???
UML profiles
Motivation
While of more immediate use for designers… mainly because
- UML “metamuddle” - UML metamodel = 246 classes and 583 properties
- concepts coming from the UML profile are somehow inbetween the meta- and the modelling layers - manipulation tools need to be tailored to support (i) profiles
applications and (ii) tagged values
Manipulating profiled UML models is (accidentally) COMPLEX
Example
ATL transformation for checking a simple naming convention
check stereotype application
access tagged value
to better support those projects in which – the system is modeled using UML profiles – there is a strong need of automatic model manipulation
Research goal and contributions
Tool developer Designers
UML-based tools
MOF metamodel
AUTOMATIC BRIDGE
GOAL
CONTRIBUTIONS • bridge between UML profiles and MOF metamodels
– fully automatic – bidirectional – transparent to designers
• metamodel slicing mechanism • implementation as an Eclipse plugin • validation via a case study based on SysML
Overview of the approach
– UML profile – profiled UML models
1. MOF metamodel MMx
2. transformations between UML models and models conforming to MMx and viceversa
The approach consists in 2 phases...
Input Output
Phase 1 – metamodelling level
MOF
UML MMX
profile.uml
c2
c2
c2
UMLprofile2MOF in out
in
Input The UML profile and the UML metamodel
Output MOF metamodel MMx
Realized as a GENERIC model-to-model transformation
Uml profile <--> MMx mappings
• Stereotype2Class• Class2Class• Profile2Package• Package2Package• Property2Feature• DataType2Datatype• Enumeration2Enumeration
UML MOF
+ an ad-hoc package in MMx containing all the UML metaclasses à the generated MOF metamodel
is self-contained à loss-less transformation
Phase 2 – modelling level
UML MMX
profile.uml c2
MMX2UML
UML2MMX
MMX2UMLGenerator
UML2MMXGenerator in in
in in
in
in
out
out
Generic higher-order transformation
Structure of UML2MMx
1. each standard UML element à an instance of its corresponding metaclass in MMx
2. each UML stereotype application à an instance of the corresponding metaclass in MMx + containment relationship
UML MOF
UML2MMx works in the other way round
UML2MMx UML
UML MOF
standard UML element à instance of its corresponding metaclass in MMx
UML stereotype application à instance of the corresponding metaclass in MMx + containment relationship
Reflections
• Phases 1 and 2 are executed only once for each UML profile px
– the generated transformations are re-used every time a UML model profiled with px has to be bridged
• The proposed bridge is completely automatic – no additional effort requested to designers
à designers work on the UML side, while tool developers work on
standard MOF metamodels à clear separation of concerns and full automation
Tool developer Designers
automatic
bridge UML-based
tools MOF
metamodel
Slicing mechanism
Default behavior of the bridge: to keep the whole UML metamodel in MMx
+ MMx is self-contained + we ensure loss-less transformation - we move the complexity of the UML metamodel into MMx
246 classes and 583 properties
SOLUTION Reduce the generated metaclasses of MMx to a subset of relevant UML concepts
Relevant concepts
UML metamodel
UML model
conforms to
Relevant concepts: the set of metaclasses that are expected to be instantiated at the modelling level
e.g., designers may assume that they will always use only UML component diagrams and state machines
Representing relevant concepts
An annotation model contains a link to each relevant metaclass of the UML metamodel
The slicing mechanism uses those links to identify the initial set of relevant metaclasses
Relevant concepts as annotation models linked to MMx
UML metamodel
AM Relevant metaclasses
Intuition it considers the set of relevant metaclasses and then navigates both their references and generalizations in order to return a self-contained subset of the initial metamodel Formally: where
neighbour(c) is the set of – all super metaclasses of c – all metaclasses referred (both with association and aggregation)
by c – all types of attributes in c
Slicing algorithm
Slicing as model transformation
MMx
MMsliced
amx
MMslicer
in
out
annotates
in
MMx2UML
MMsliced
Tslicer
UML2MMx
MMsliced2UML
UML2MMsliced
in
out
in
Slicing metamodels Slicing transformations
Creation of annotation models
from a UML profile from diagram names from example models
+ full control - tedious and error-prone
OR
via 3 different strategies:
Manual creation
Automatic generation
Implementation of the approach Approach implemented as an plugin
+ reuse of existing facilities + easy integration with other Eclipse-based components
Models and metamodels via the framework
+ already implemented MOF meta-metamodel + persistence support via XMI
UML profiles and models via the Eclipse plugin
+ interoperability with other UML modelling tools
Transformations and annotations models based on the platform
+ ATL as flexible model transformation language + transformations can be executed programmatically (e.g., via Java code) + support for transformation models à enabling HOT transformations + integrated into the Eclipse platform
UML2
AMMA
Validation of the approach
We applied the proposed approach on a non-trivial case study based on the SysML profile The SysML profile has been extracted from the official SysML Eclipse plugin The SysML model is the example provided in the SysML official specification. The model represents a HSUV* by focussing on its requirements, performance, structure, and behavior
* HSUV = Hybrid gas/electric powered Sport Utility Vehicle (HSUV)
Generating the SysML metamodel 1
UML metamodel
SysML profile
UMLprofile2MOF MMsysml
c2
= bridge-specific ATL transformation
metamodeling
modeling
322 metaclasses 122 attributes 665 references
Generating the transformation 2
UML metamodel
SysML profile
UMLprofile2MOF MMsysml
UML2MMx Generator
UML2MMsysml
c2
= bridge-specific ATL transformation
metamodeling
modeling
292 transformation rules 3625 feature bindings 10 helpers TOTAL: 5680 LOCs
Annotation model creation 3
UML metamodel
SysML profile
UMLprofile2MOF MMsysml
amsysml
annotation
UML2MMx Generator
UML2MMsysml
c2
= bridge-specific ATL transformation
metamodeling
modeling
Slicing by component and class diagrams 37 links generated
Slicing 4
UML metamodel
SysML profile
UMLprofile2MOF MMsysml
amsysml
annotation
sliced MMsysml
MMslicer
UML2MMx Generator
UML2MMsysml
Tslicer
UML2slicedMMsysml
c2
= bridge-specific ATL transformation
metamodeling
modeling
Slicing gains
292
3625
10
5680
139
1721
10
2690
0
1000
2000
3000
4000
5000
6000
Full transformation Sliced transformation
Overall we gained: ~37% in metamodel size ~52% in transformation size
322
122
665
171 80
460
0
100
200
300
400
500
600
700
MMx MMsliced
Modelling & transforming 6 5
UML metamodel
SysML profile
UMLprofile2MOF MMsysml
amsysml
annotation
sliced MMsysml
MMslicer
UML2MMx Generator
UML2MMsysml
Tslicer
UML2slicedMMsysml
HSUV.uml HSUV.xmi
c2
c2
c2 application
= bridge-specific ATL transformation
metamodeling
modeling
Using the model 7
We developed a simple manipulation transformation that checks if a SysML model follows a simple naming convention
+ the input domain of the transformation is smaller à more testable + UML-specific constructs not needed anymore à more maintainable + gain in performance
Conclusions
Modelling & transforming 6 5
UML metamodel
SysML profile
UMLprofile2MOF MMsysml
amsysml
annotation
sliced MMsysml
MMslicer
UML2MMx Generator
UML2MMsysml
Tslicer
UML2slicedMMsysml
HSUV.uml HSUV.xmi
c2
c2
c2 application
= bridge-specific ATL transformation
metamodeling
modeling
Slicing mechanism
Default behavior of the bridge: to keep the whole UML metamodel in MMx
+ MMx is self-contained + we ensure loss-less transformation - we move the complexity of the UML metamodel into MMx
246 classes and 583 properties
SOLUTION To reduce the generated metaclasses of MMx to a subset of relevant UML concepts
to support those projects in which – the system is modeled using UML profiles – there is a strong need of automatic model manipulation
Research goal and contributions
Tool developer Designers
UML-based tools
MOF metamodel
AUTOMATIC BRIDGE
GOAL
CONTRIBUTIONS • bridge between UML profiles and MOF metamodels – fully automatic – bidirectional – transparent to designers
• metamodel slicing mechanism • implementation as an Eclipse plugin • validation via a third-party case study based on SysML
Overview of the approach
– UML profile – profiled UML models
1. MOF metamodel MMx
2. transformations between UML models and models conforming to MMx and viceversa
The approach consists in 2 phases...
Input Output
References
[1] I. Malavolta and H. Muccini, “A Study on MDE Approaches for Engineering Wireless Sensor Networks,” in Software Engineering and Advanced Applications (SEAA), 2014 40th EUROMICRO Conference on. IEEE, 2014, pp. 149–157. [2] A. van Deursen, P. Klint, and J. Visser, “Domain-specific languages: an annotated bibliography,” SIGPLAN Not., vol. 35, pp. 26–36, June 2000. [Online]. Available: http://doi.acm.org/10.1145/352029.352035 [3] R. B. France, S. Ghosh, T. Dinh-Trong, and A. Solberg, “Model- Driven Development Using UML 2.0: Promises and Pitfalls,” Computer, vol. 39, pp. 59–66, 2006. [4] L. Fuentes-Fernandez and A. Vallecillo-Moreno, “An introduction to UML profiles,” in UML and Model Engineering, vol. 5, 2004.
Contact Ivano Malavolta |
Post-doc researcher Gran Sasso Science Institute
iivanoo
www.ivanomalavolta.com