%$Id: solution.tex 16754 2009-02-09 02:36:15Z gokhale $

\sqztiny
\section{Templatized Model Transformations}
\label{sec:soln}
\sqztiny

This section presents MTS (Model-transformation Templatization and
Specialization). The core idea of MTS is shown in
Figure~\ref{fig:approach}.  MTS realizes reusable model transformations
in graphical model transformation frameworks using the following
four-step approach:

\noindent\textbf{1. Decoupling the variabilities from commonalities:} In
Step 1 of Figure~\ref{fig:approach}, developers capture the variabilities
in transformations in terms of a simple \emph{constraint notation
  specification} (see Section~\ref{sec:variab}).  This  step decouples
the transformation algorithm from its variabilities that can change in
an instance-specific manner.   

\noindent\textbf{2. Generating variability metamodel:} In this step,
developers use a higher order transformation (HOT) (\emph{i.e.}, 
those model transformations that work on meta metamodels to 
translate source metamodel(s) to target metamodel(s)) defined in MTS to
automatically generate the variability metamodel (VMM) for their
application family (see Section~\ref{sec:gen-VMM}).  A VMM modularizes
the variability in the form of a metamodel, which is the
level of abstraction required by the underlying model transformation
tool.  

\noindent\textbf{3. Synthesizing specialization repository:}  Next,
developers create VMM models, where each VMM model corresponds
to an instantiation of the variability for individial family members
captured in Step 1.  A collection of all the VMM models is termed as a
specialization repository for that family (see Section~\ref{sec:sprepo}).

\noindent\textbf{4. Specializing the application instances:} Finally, 
as shown in Step 4, developers use another HOT defined in MTS to create
transformation variants (see Section~\ref{sec:specialize}).  This step
is similar to instantiating a C++ template where the compiler generates
type-specific code based on the type of the argument passed.

\begin{figure}[htb]
%\vspace{-.2in}
\centering
\includegraphics[width=0.9\columnwidth,keepaspectratio]{approach}
\vspace{-.1in}
\bfcaption{MTS Approach to Reusable Model Transformations.}
\label{fig:approach}
\vspace{-.1in}
\end{figure}

The remainder of this section provides details of each step, and
describes how it supports the four properties (\emph{i.e.},
\emph{Invariants,} \emph{Variability,} \emph{Extensibility,} and
\emph{Minimal Intrusiveness}) outlined in Section~\ref{sec:intro}.

\input{stepI}
\input{stepII}
\input{stepIII}
\input{stepIV}


