26
© Copyright 2008 Obeo.; made available under the EPL v1.0 | March 20, 2008 Jonathan Musset [email protected] [email protected] Obeo France OMG model transformation standard in Eclipse 2 similar experiences : QVT-R and MTL ...

QVT & MTL In Eclipse

Embed Size (px)

Citation preview

Page 1: QVT & MTL In Eclipse

© Copyright 2008 Obeo.; made available under the EPL v1.0 | March 20, 2008

Jonathan Musset [email protected]

[email protected]

ObeoFrance

OMG model transformation standard in Eclipse

2 similar experiences : QVT-R and MTL ...

Page 2: QVT & MTL In Eclipse

© Copyright 2008 Obeo.; made available under the EPL v1.0 | March 20, 2008

Obeo

8 Eclipse commiters

Eclipse Modeling Project M2M

Declarative QVT ATL industrialization

M2T : MTL EMF : EMF Compare

Eclipse STP – SCA

OW2 Consortium - Acceleo

Page 3: QVT & MTL In Eclipse

© Copyright 2008 Obeo.; made available under the EPL v1.0 | March 20, 2008

OMG adopts standardTo facilitate portability, interoperability and reusability

Needs for software developmentSystem complexity, Business ability, Projects duration

Solution : MDA approachHigh level design models at the heart of the development processSoftware development automationBenefits : Productivity, agility, reliability

OMG

Page 4: QVT & MTL In Eclipse

© Copyright 2008 Obeo.; made available under the EPL v1.0 | March 20, 2008

Two complementary approaches for automationModel To Model

QVT addresses the needs of model – to – model transformationPIM – to – PIM, PIM – to – PSM, PSM – to – PSM...

MOF Model To TextMTL : How to translate a model to various text artifacts?PSM – to – code, PSM – to – report...

OMG

Page 5: QVT & MTL In Eclipse

© Copyright 2008 Obeo.; made available under the EPL v1.0 | March 20, 2008

Working with model transformations in Eclipse ?

Page 6: QVT & MTL In Eclipse

© Copyright 2008 Obeo.; made available under the EPL v1.0 | March 20, 2008

M2M : Transform models to models

ATL - Atlas Transformation Language QVTOM - Procedural QVT (Operational Mappings) QVTR - Declarative QVT (Core and Relations) Java/EMF?

Page 7: QVT & MTL In Eclipse

© Copyright 2008 Obeo.; made available under the EPL v1.0 | March 20, 2008

M2T : Generate text from models

3 languagesJET : JSP-like template filesMTL : OMG StandardXpand : OAW Language

1 frameworkM2T Core

With a Backend, Like a VM

Page 8: QVT & MTL In Eclipse

© Copyright 2008 Obeo.; made available under the EPL v1.0 | March 20, 2008

Work started in August 2007

History and roadmapCommon proposal Obeo-Lina in July 2007Initial implementation : QVT-R compiler targeting ATL-VMFirst release in February 2008 - Run a QVT-R transformation (check and enforce)Next steps :

Design and edit within the Eclipse IDEQVT-Core targeting ATL-VM

M2M : Focus on QVT Relations

Page 9: QVT & MTL In Eclipse

© Copyright 2008 Obeo.; made available under the EPL v1.0 | March 20, 2008

Architecture « An abstract and a concrete syntax »Driven by the will to reuse some existing Eclipse componentsGeneration of the ATL Virtual Machine byte code

M2M : Focus on QVT Relations

Page 10: QVT & MTL In Eclipse

© Copyright 2008 Obeo.; made available under the EPL v1.0 | March 20, 2008

Work started in January 2008

History and roadmapRelaunch proposal in December 2007First stable version in June 2008

Standalone engine and parserAbstract syntax compliance – model formConcrete syntax compliance – concrete syntax form (Text explicit only)

First release in June 2009Eclipse IDE components : editors, builders...Core feature compliance : Template, Query, and Module.First step for the Advanced feature compliance

M2T : Focus on MTL

Page 11: QVT & MTL In Eclipse

© Copyright 2008 Obeo.; made available under the EPL v1.0 | March 20, 2008

Architecture « An abstract and a concrete syntax »Driven by the will to reuse some existing Eclipse components : EMF, M2T, OCL

M2T : Focus on MTL

Page 12: QVT & MTL In Eclipse

© Copyright 2008 Obeo.; made available under the EPL v1.0 | March 20, 2008

Reusing frameworks : EMF, M2T Backend...

Interoperability with strategic languagesQVT - ATLMTL - JET - Xpand

Ecore vs MOFQVT Relations abstract syntax is defined as an extension of MOFMTL abstract syntax is also defined as an extension of MOFIn Eclipse, We have to use Ecore and EMF...EMF URI to identify a metamodel – An interoperability issue

A standard in Eclipse – What does it mean?

Page 13: QVT & MTL In Eclipse

© Copyright 2008 Obeo.; made available under the EPL v1.0 | March 20, 2008

What can we do when an Eclipse concept is better?A transformation module is an eclipse plugin... What else?The MANIFEST.MF file should be used to declare dependencies between modulesEMF URI problems : “plugin” or “workspace”? 

A standard in Eclipse – What does it mean?

Page 14: QVT & MTL In Eclipse

© Copyright 2008 Obeo.; made available under the EPL v1.0 | March 20, 2008

Not easy to ensure interoperability with other standard tools (1)

Page 15: QVT & MTL In Eclipse

© Copyright 2008 Obeo.; made available under the EPL v1.0 | March 20, 2008

OMG HelpAll specifications are subject to continuous review and improvementThe OMG encourages readers to report any ambiguitiesBut, not easy to make changes in the specification (a lot of authors)We need a human understanding to solve ambiguities

MTL experienceWe haven't 200 pages2 authors of the specifications are in the team

Arjan KokWim Bast

A solution? The best way to solve ambiguities

An ambiguity in the specification – What can I do?

Page 16: QVT & MTL In Eclipse

© Copyright 2008 Obeo.; made available under the EPL v1.0 | March 20, 2008

What kind of ambiguities?

Page 17: QVT & MTL In Eclipse

© Copyright 2008 Obeo.; made available under the EPL v1.0 | March 20, 2008

The “delete” semantic

A domain hasn't DIRECTIONOD.DIRECTION => OD.TYPED_MODEL?

Naming issues"ISCHECKED" in the semantic and "isCkeckable" in the meta-model

Ambiguities - QVT Relations

Page 18: QVT & MTL In Eclipse

© Copyright 2008 Obeo.; made available under the EPL v1.0 | March 20, 2008

The “enforce” semanticWhat is the difference between “domain_pattern” and “domain_condition”?

Semantic : Is “domain_pattern” a boolean?

Ambiguities - QVT Relations

Page 19: QVT & MTL In Eclipse

© Copyright 2008 Obeo.; made available under the EPL v1.0 | March 20, 2008

Ambiguities - QVT Relations

Redundancy – TemplateExpression (referredClass == bindsTo.type)

➔ TemplateExpression's bind to a Variable (typed element)➔ ObjectTemplateExpression's subtype

The QVT Base Package

Page 20: QVT & MTL In Eclipse

© Copyright 2008 Obeo.; made available under the EPL v1.0 | March 20, 2008

Naming conventionsThe plural mustn't end with 's'

Ambiguities - MTL

Page 21: QVT & MTL In Eclipse

© Copyright 2008 Obeo.; made available under the EPL v1.0 | March 20, 2008

ProtectedArea (interoperability issue)

The delimiters of the protected area are not defined is the standard

It should define how to specify the target delimiter in the generated code

Ambiguities - MTL

Page 22: QVT & MTL In Eclipse

© Copyright 2008 Obeo.; made available under the EPL v1.0 | March 20, 2008

The given meta-model isn't valid

Ambiguities - MTL

Page 23: QVT & MTL In Eclipse

© Copyright 2008 Obeo.; made available under the EPL v1.0 | March 20, 2008

String libraries are differentQVT : toFirstUpperMTL : toUpperFirst

Link resolution : MTL example - TemplateInvocationMeta-model : The “definition” reference to the invoked template must be set and a

template can be in another plugin.Real life : The compiler can't choose the template to invokeSolution : string, template registry, classloader...

QVT and MTL interoperabilityIs it possible to call a MTL template in a QVT transformation?

Ambiguities – QVT and MTL

Page 24: QVT & MTL In Eclipse

© Copyright 2008 Obeo.; made available under the EPL v1.0 | March 20, 2008

Not easy to ensure interoperability with other standard tools (2)

Page 25: QVT & MTL In Eclipse

© Copyright 2008 Obeo.; made available under the EPL v1.0 | March 20, 2008

Abstract syntax – priority is Eclipse (execution) Concrete syntax – priority is the specification (reusability)

OMG - QVT and MTL interoperability? Eclipse - M2T and M2M interoperability?

OMG Specifications and Eclipse Projects interoperability ;-)

Conclusion

Page 26: QVT & MTL In Eclipse

© Copyright 2008 Obeo.; made available under the EPL v1.0 | March 20, 2008

Thanks for your attention, any question ?

Further information : http://www.omg.org/ http://www.eclipse.org/m2m http://www.eclipse.org/m2t http://www.obeo.fr