A model compiler takes a set of executable UML models and weaves them together according to a consistent set of rules. This task involves executing the mapping functions between the various models to produce a single, all-encompassing model that includes all the structure, behavior and logiceverythingin the system. Executable UML is the metamodel for the individual models that the compiler weaves together. The metamodel for the single model that the weaving produces is a metamodel of a unified system architecture. The model compiler's weaving logic is written with respect to these metamodels because it does not have foreknowledge of specific models. The compiler applies this generic logic to source models that conform to the executable UML metamodel and produces target models that conform to the architecture metamodel.
Weaving the models together at once addresses the problem of architectural mismatch, a term coined by David Garlan to refer to components that do not fit together without the addition of tubes and tubes of glue code, the very problem MDA is intended to avoid! A model compiler imposes a single architectural structure on the system as a whole.
The final mapping from this metamodel can be done in several ways. One approach to defining mapping functions is to use an archetype. An archetype is a fragment of model access and text manipulation logic that states formally how to transform some executable UML into Java, C++, or into some other kind of text. Note that the nascent OMG QVT (Query, View, Transformation) work is defining a standard means for expressing mappings among metamodels. Also, the OMG recently issued a Request for Proposal for a standard way to express a mapping from a metamodel to text. Archetypes are one way to address that RFP.
Figure 3 A silo of successive transformations