MDA Transforms

Return to Introduction  Previous page  Next page

MDA  transforms provide a fully configurable way of converting model elements and model fragments from one domain to another. This typically involves converting Platform-Independent Model (PIM) elements to Platform-Specific Model (PSM) elements. A single element from the PIM can be responsible for creating multiple PSM elements across multiple domains.

Transformations are a huge productivity boost, and reduce the necessity of manually implementing stock classes and elements for a particular implementation domain: for example, database tables generated from persistent PIM classes. Enterprise Architect includes some basic built-in transformations, such as PIM to Data Model, PIM to C#, PIM to Java and PIM to XSD. Sparx Systems will make further transformations available over time, either as built in transformations or as downloadable modules from the Sparx Systems website.

For a further productivity boost, Enterprise Architect can automatically generate code for your transformed classes that target code languages. See the Generate Code on result option on the Model Transformation dialog.

A Transformation is defined using Enterprise Architect's simple code generation template language, and involves no more than writing a template to create a simple intermediary source file. Enterprise Architect reads the source file and binds that to the new PSM. Enterprise Architect also creates internal bindings between each PSM created and the original PIM. This is essential, as it enables you to forward synchronize from the PIM to the PSM many times, adding or deleting features as you go. For example, adding a new attribute to a PIM class can be forward synchronized to a new column in the Data Model.

Enterprise Architect does not delete or overwrite any element features that were not originally generated by the transform. Therefore, you can add new methods to your elements, and Enterprise Architect does not act on them during the forward generation process.

Note: if you are using the Enterprise Architect Corporate edition, if security is enabled you must have Transform Package access permission to perform an MDA Transform on a package.

The following diagram highlights how Transforms work and how they can significantly boost your productivity:

How MDA Transforms Work

Transformations that are currently built-in include:

·DDL - Transforms platform-independent class elements to platform-specific table elements
·EJB Entity - Transforms platform-independent class elements to packages containing the class and interface elements that comprise an EJB Entity Bean
·EJB Session - Transforms platform-independent class elements to packages containing the class and interface elements that comprise an EJB Session Bean
·Java - Transforms platform-independent elements to Java language elements
·JUnit - Converts a Java model to a model where test methods are created for each public method of any original class
·C# - Converts a PIM to a standard C# implementation set
·NUnit - Converts a .Net language specific model to a model where test methods are created for each public method of any original class
·WSDL - Converts a simple representation of a WSDL interface into the elements required to generate that interface
·XSD - Transforms platform-independent elements to XSD elements.

Transformations are described in the following topics: