210 likes | 325 Views
Achieving QVTO & ATL Interoperability. naam. Alfons Laarman. Overview. Motivation Goals ATL Architecture QVT Standard Approach QVTO to ATLVM “ Compiler ” Results Conclusions References. Motivation. Different model transformation languages: QVT, ATL, etc
E N D
Achieving QVTO & ATL Interoperability naam Alfons Laarman
Overview • Motivation • Goals • ATL Architecture • QVT Standard • Approach • QVTO to ATLVM “Compiler” • Results • Conclusions • References
Motivation • Different model transformation languages: QVT, ATL, etc • Each has its own strengths and downsides (these include the properties of the provided tools) • Tool interoperability would allow a developer to use his/her language of preference
Source: Jouault & Kurtev 2006
Goals • Develop, compile and run QVTO transformations in the ATL toolset • Aim at complete QVTO support • Proof hypothesis of Jouault & Kurtev • Proof ATL tools to be QVT(O) conformant
ATL Architecture • ATL has a virtual machine architecture The ATL Wiki, William Piers
ATL Architecture (2) • The ATL virtual machine is: • Object-oriented • Stack-based • Model manipulation language context QVT!Object def : container() { load self; call ‘J.refImmediateComposite() : J‘; }
QVT Standard • QVT is an OMG standard for model transformations defining 3 languages and 3 conformance levels
QVT Operational • Completely imperative mappings • Trace sensitive mapping execution • Mapping combination: inheritance, merging and disjunction • Transformation handling
EntryOperation Imperative rule call transformation Uml2Rdb(in srcModel:UML,out destModel:RDBMS); main() { srcModel.objects()[Class]->map class2table(); } mapping Class::class2table () : Table when {self.kind='persistent';} { init { self.leafAttributes := self.attribute->map attr2LeafAttrs(); } name := 't_' + self.name; column := self.leafAttributes->map leafAttr2OrdinaryColumn(""); key := object Key { name := 'k_'+ self.name; column := result.column[kind='primary']; }; } OO Trace sensitive Multiple parameters: context, result and in/out/inout inherit disjunct merge Guard Initiation section Implicit target element creation Population section (end section)
Approach • Reuse SmartQVT Front-end • Express QVTO semantics on the ATLVM using ACG
Other language constructs • ImperativeCallExp • HelperOperation, ConstructorOperation and EntryOperation • ResolveExp • TransformationCallExp, etc
For/Break/Continue push collection iterate element push element <process> <break/continue> <process> enditerate
Results QVTO completely implemented except for transformation handling constructs Demonstrated by running examples: • UML22RDBMS (extended) • UML2Ecore • Ecore2EMOF • Industrial case from Obeo (concerning automated porting to Java)
Conclusions • ATL tools are flexible and interoperability is easy to create (at least for an imperative lang.). Efforts have been made for QVTR • The rule level semantics of QVT can be handled directly by ATL. Transformation level semantics not, but can be handled outside by (generated) scripts • Interoperability at lower granularity is possible: super imposition and blackbox operations (future work) • Exceptions and imperative operations like break are hard to express on ATLVM • ATL tools can now be considered QVT(O) conformant
References • ATL Industrialization, www.atlpro.org • QVT ATL On the architectural alignment of ATL and QVT Fréderíc Jouault & Ivan Kurtev. 2006 • QVTR to ATLVM. http://eclipse.org/m2m, Quentin Glineur • QVTR to QVTO: Translation of QVT Relations into QVT Operational Mappings Raphael Romeikat, Stephan Roser, Pascal Müllender, Bernhard Bauer. 2009