You can create template-based
model-to-text transformations that enable you to define a transformation
based on one or more exemplar projects. Exemplar projects are established
solutions to common development problems. The Eclipse Modeling Framework
Technology (EMFT) Java Emitter Templates (JET) transformations
that you create can be invoked directly by users, consumed by other Java code, or combined with other model-to-text
transformations to generate more complex transformations. You can
create JET transformations that use templates to automate repetitive
activities to provide more consistent solutions.
Before you begin
Exemplar projects are Eclipse
projects that are examples of the application files and folders that
you want a model-to-text transformation to generate. You can define
a transformation input schema that describes the variable elements
of the exemplar and then associate code generation actions with these
schema elements. The files that the transformation creates use JET
templates that are based on the exemplar artifacts. You complete the
JET transformation authoring process by modifying these templates
to include content that is derived from the transformation input.
When
you run a JET transformation, it generates a solution similar to the
exemplar artifacts, but the solution is customized to meet the requirements
that are specified in the transformation input. You can implement
JET transformations to automate the generation of the following types
of applications:
- Deployment scripts that migrate applications from development
environments to test and production environments
- Infrastructure code, for example, entity and session beans, session
facades, and data transfer objects for EJB applications that are based
on best practices
- Java code that implements model-to-model transformations
By automating the generation of these types of applications,
you can reduce the number of errors in the application, produce application
code more quickly, and ensure adherence to project or organizational
standards.
A JET newsgroup is available from the Eclipse Web
site. You can subscribe to the newsgroup by following the link to
the Eclipse Web site in the Related information section below, and
searching for the eclipse.modeling.m2t newsgroup. See the Related
information section for links to additional JET content.