Eclipse Model-to-Text (M2T) Transformation Project Proposal
The project has been created. Please visit the project page.
Revised: Dec 7, 2006
The Model-to-Text Transformation (M2T) Transformation Project is a proposed open source project under the Eclipse Modeling Project.
This proposal is in the Project Pre-Proposal Phase (as defined in the Eclipse Development Process document) and is written to declare its intent and scope. This proposal is written to solicit additional participation and input from the Eclipse community. You are invited to comment and/or join the project. Please send all feedback to the http://www.eclipse.org/newsportal/thread.php?group=eclipse.modeling.m2t newsgroup.
Model Driven Development (MDD) and OMG Model Drive Architecture (MDA) emphasize the creation of models of a software solution which are then refined and transformed until ultimately source code (e.g. Java, C++) and associated resources (e.g. properties files, configuration files) are created. The Model-to-Model (M2M) Transformations Project proposal (http://www.eclipse.org/proposals/m2m/) focuses on technologies to transform between different models. This proposal focuses on technologies for transforming models into text (typically language source code and the resources it consumes).
Solutions for model-to-text transformations generally make use of "templates". A template may be generally described as a text sequence interspersed with commands that extract information from a model. Commands are not limited to information extraction – they often serve as flow control in a template; controlling whether and how many times blocks of text are processed.
There are a large number of template languages – a Google search on ‘template language’ yields 258,000 hits. The parties interested in this proposal represent or have interest in the following languages.
- JET, a derivative of JavaServer Pages (JSP) initially developed as part of the Eclipse Modeling Framework (EMF), and currently an incubator project in the Eclipse Modeling Project.
- XPand, the template language that is part of openArchitectureWare.
- Acceleo template language, part of OBEO’s Acceleo MDA generator.
- OMG MOF Model to Text, a recently approved OMG standard for text generation from MOF models; intended to complement OMG QVT.
One of the concerns of this project is to reduce the duplicate effort involved in developing and maintaining template languages.
Technologies of a Model-to-Text solution
Expanding templates is only a part of the requirements for a Model-to-Text solution. In addition, solutions must typically have:
- A mechanism for accessing and navigating diverse input models.
- A mechanism to add "derived" properties to existing meta models. Such additional properties are almost always required for real-world generators.
- A mechanism for orchestrating template execution, and saving their results to a file system. In the Eclipse environment, this includes playing well with Team providers, and correctly handling file encodings.
- A mechanism for integrating generated and manually written code. This encompasses respecting and reconciling user changes when regenerated output is merged with user modified output, as well as providing tool support for "enforcing" conventions (such as e.g. that developers have to create a subclass from a generated class and implement certain methods)
In many cases, these "template language technologies" can be implemented in a language independent fashion.
The M2T project will deliver the following:
- An extensible framework (the M2T Invocation Framework) for integrating model-to-text languages into MDD/MDA solutions. The initial goals of this framework would be to allow API consumers to:
- Invoke a component supplied template independently of the template language used.
- Permit runtime substitution of a user supplied template for a component supplied template, regardless of the template languages used by either. That is, the two templates may be implemented by different languages.
- Invoke a component supplied code generator independently of the technology used to create the code generator.
- Permit runtime substitution of a user supplied code generator for a component supplied code generator, regardless of the code generator technologies employed.
- APIs to implement common template language technologies. The primary consumers of these APIs would be template language implementations themselves.
- Implementations of template languages strategic to the Eclipse Modeling Project. These include:
- OMG MOF Model to Text
- For each strategic template language:
- Integrations into the M2T Invocation Framework.
- Template editors.
- Various tools/approaches for integrating generated and manually written code, such as protected region management, merging support, a recipe framework
Implementations will use EMF Ecore meta-models (www.eclipse.org/emf) as the primary meta-model for consumed models.
Because M2T should not become a warehouse for model-to-text languages, the project will host only languages deemed strategic to the goals of the Eclipse Modeling Project. Most existing languages already have a "home", and there would be little benefit from migration to a new project. At inception, the JET language has been identified as strategic because of its long association with EMF. The XPand language from openArchitectureWare is also strategic. The OMG MOF Model to Text language is strategic because it is represents an emerging a standard in the model-to-text domain. Each strategic language will be a separate component so as to be separately distributable and installable.
Similarly, integrations with the M2T Invocation Framework should be hosted in the same project as the model-to-text language itself. However, in cases where this is not possible and the integration is strategic to the goals of the Eclipse Modeling Project, the M2T project can serve as the host project. Again, each such integration will be a separate component so as to be separately distributable and installable.
The following code will be contributed to the project:
- JET, from the EMFT JET subproject.
- Utility features (JMerge, ImportsManager) from the JET component of EMF.
- JET Editor, from the EMFT JETEditor subproject.
- XPand and its required oAW components (expression language, XTend)
- Appropriate oAW editors (XPand editor, XTend editor)
- oAW’s Recipe Framework for integrating generated and manually written code
- Compuware has offered two committers to implement the OMG MOF-Model-to-Text (MM2T) standard. There would be entirely new development.
We propose that this project be undertaken as part of the Eclipse Modeling Project. It will have dependencies on the Eclipse Platform, including the JDT and EMF.
Further more, it is proposed that the project be divided into components as follows. Each component would have a lead and its own committers (although nothing would prevent one committer working on several components).
- Model-to-Text Invocation Framework (M2T-IF)
- Shared components
- OMG MOF Model to Text (MM2T)
The following companies will contribute committers to get the project started:
- IBM (www.ibm.com)
- Paul Elder (proposed project lead) - JET, M2T-IF, Shared components
- Markus Voelter - XPand, Shared components
- Sven Efftinge - XPand
- Bernd Kolb - XPand
- Two (2) committers for OMG Model to Text
- Joel Cheuoua - JET (JET editor)
- TBD - shared components
Artem Tikhomirov (Borland) - a version of XPand that uses LPG rather than Antlr
The following organizations have expressed interest in the project:
- openArchitectureWare (www.openarchitectureware.org)
- Borland (GMF)
- GMF has proposed embedding XPand as template technology for GMF..
- OBEO (www.obeo.fr) – creators of Accelio MDA.
- OBEO is interested in contributing the following technologies:
- Reflective editor between model and text.
- Editor technology for JET.
- ILOG (www.ilog.com) – currently working on the EMFT Jet Editor
- IBM (JET)
Critical to the success of this project is participation of developers in the modeling application development community. We intend to reach out to this community and enlist the support of those interested in making a success of the Model-to-Text Transformation project. We ask interested parties to contact the M2T newsgroup to express interest in contributing to the project.