Java Reference
In-Depth Information
It's worth pointing out that a third option will soon be available from M2T.
The Model to Text Language (MTL) component will provide an implementation
of the OMG's MOF Model to Text Language standard. Furthermore, Core and
Shared components are planned for M2T, with the goal of providing shared com-
ponents and a framework for the invocation of M2T transformations, regardless
of the language. None of these components were available at the time of this
writing, but future editions of this topic might cover them.
7.1.1 Xpand, Xtend, and Workflow Components
Originally from the Generative Modeling Technologies (GMT) project, the
Xpand template engine moved to M2T and is used extensively within the GMF
project. In fact, GMF includes a refactored version of the Xpand engine and edi-
tor for use in GMF until the enhancements added have been incorporated into
Xpand, following its move to the M2T project. More recently, the GMF project
refactored its version of Xpand to remove the use of Xtend and its proprietary
expression language, and replace it with Object Constraint Language (OCL) and
Query/View/Transformation (QVT) Operational Mapping Language. The exam-
ples in this topic likely will be refactored to use this version of Xpand in the
future.
Xpand itself has basic syntax but uses an underlying expression language and
Xtend to provide powerful M2T (and even M2M) capabilities. Xpand also can
be used within the context of EMF Technology (EMFT) Workflow component.
This component allows for an Ant-like XML representation of model transfor-
mation invocations that can be chained into a workflow. Because workflow is the
easiest way to invoke Xpand templates for use in code generation, I cover it in
basic detail as well. When using the GMF version of Xpand, Ant tasks can be
used to invoke templates; when combined with Ant tasks provided by M2M
QVTO, these make another viable workflow option.
Wizards available for creating new Xpand and Xtend files are located in the
Model Transformation category when using the Amalgam DSL Toolkit down-
load. Otherwise, they are located in the Xpand and Xtend categories of the New
dialog, respectively. Also present is a wizard for creating Check files, which are
not discussed in the context of this topic. Additionally, an action is contributed
to the project right-click menu to add or remove the Xpand/Xtend nature. When
using this action, the following buildCommand and nature is added to your
.project file. Note that DSL Toolkit projects come preconfigured with this
nature and builder.
Search WWH ::




Custom Search