Model Transformations - MDA
Model Driven Architecture (MDA) Transformations 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 (Transformation Dependencies) 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. You can observe the Transformation Dependencies for a package using the Traceability window. This enables you to check the impact of changes to a PIM element on the corresponding elements in each generated PSM, or to verify where a change required in a PSM should be initiated in the PIM (and also to reflect back in other PSMs). The Transformation Dependencies are a valuable tool in managing the traceability of your models.
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.
If you are using the Corporate, Business and Software Engineering, System Engineering or Ultimate 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 Transformations work and how they can significantly boost your productivity:
Transformations that are currently built-in include:
- C# - Converts a PIM to a standard C# implementation set
- Data Model to ERD - Transforms a Data Model to an Entity Relationship Diagram (ERD)
- 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
- ERD to Data Model - Transforms an Entity Relationship Diagram into a Data Model
- 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
- 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:
- Transform Elements
- Import Transformations
- Transformation Templates
- Built-in Transformations
- Write Transformations
- Chaining Transformations