<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Model Transformation Design Patterns</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Hüseyin Ergin hergin@crimson.ua.edu</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Computer Science, University of Alabama</institution>
          ,
          <country country="US">U.S.A</country>
        </aff>
      </contrib-group>
      <fpage>25</fpage>
      <lpage>31</lpage>
      <abstract>
        <p>In this document, a brief overview of my doctoral research is presented. In model-driven engineering (MDE), most problems are solved using model transformation. An efficient process to solving these problems is to apply reusable patterns while solving them. Finding reusable design patterns to specific subsets of problems helps to decrease the time and cost needed to solve them. My doctoral research is based on finding these design patterns to be applied on model transformation problems and evaluating them in terms of quality criteria. My next step is to generate these design pattern instances automatically by using higher-order transformation.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        MDE problems are solved using a series of model transformations. Model
transformations have their own languages and they consist of two main components: rules and
scheduling. Rules are the smallest units of a model transformation and are used to
transform one or more elements from source language to their intended equivalents in target
language. Scheduling describes the order in which rules are executed. To develop a
model transformation, developers design different rules and specify the scheduling of
them. However, this design phase lacks reusability, which hampers the quality of model
transformations. Therefore, there is a need for reusable, proven, and qualified structures
in this phase. A design pattern encapsulates a proven solution to a recurring design
problem [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. As in the object-oriented world, design patterns help with the assessment
of high quality model transformations. The first purpose of this doctoral research is to
find design patterns that help developers to solve model transformation problems. In
object-oriented design patterns, the community has agreed to provide design patterns
in UML class diagrams. Due to the few works in the literature, there is no common
language or standard for the model transformation field. Another purpose is to find the
best formalism to express existing and newly identified model transformation design
patterns.
3
      </p>
    </sec>
    <sec id="sec-2">
      <title>Related Work</title>
      <p>I have identified two studies in literature that introduce reusable structures in model
transformation.</p>
      <p>
        Agrawal et al. [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] used GReAT language to define three model transformation
design patterns. This is the first structured design pattern study in the model
transformation field. Each design pattern has motivation, applicability, structure, known uses,
limitation, and benefits fields. They introduced the following design patterns: the leaf
collector, which has a visitor pattern [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] like structure and aims to collect or process
all leaf nodes in a hierarchy; the transitive closure, which can be used to compute the
transitive closure of a graph; and the proxy generator idiom, which can be used in
distributed systems where remote interactions to the system need to be abstracted and
optimized.
      </p>
      <p>
        Iacob et al. [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] used QVT Relations language to define five model transformation
design patterns. Their design pattern structure has name, goal, motivation,
specification, example, and applicability fields. They introduced the following design patterns:
the mapping pattern, which establishes one-to-one relations between elements from the
source model and elements from the target model and can be used to translate a model
from one syntax to another; the refinement pattern, which obtains a more detailed target
model by refining an edge or a node to multiple edges or nodes; the node abstraction
pattern, which abstracts information from source nodes while keeping their relations
and can be used to remove elements from models that hold certain criteria; the
duality pattern, which generates a semantic dual of an instance model; and the flattening
pattern, which removes the hierarchy from the source model.
      </p>
      <p>These studies are excellent resources, but need to be analyzed, extended and
improved. First, the design patterns are not analyzed in terms of quality. Agrawal et al. and
Iacob et al. introduce design patterns as the core of their studies, but often do not
mention how they affect quality in model transformation problems. Secondly, they often do
not provide a generic way of representing design patterns in terms of a design pattern
formalism.</p>
      <p>In this work, I extend these studies with a generic formalism, evaluation of proposed
design patterns and identication of new design patterns.
4</p>
    </sec>
    <sec id="sec-3">
      <title>Solution</title>
      <p>In this dissertation, I focus on the solution to the reusability problem by working on
design patterns. The initial step in this direction is to identify a design pattern formalism.
The formalism is important in terms of providing the standardization of future design
patterns and automically applying them to the transformations. The formalism will also
provide an abstract representation of the solution independent from different model
transformation languages. In this section, I provide some details about the solution in
this direction.
4.1</p>
      <sec id="sec-3-1">
        <title>Preliminary Work</title>
        <p>
          In [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ], I have identified a model transformation design pattern, called Fixed-point
Iteration. This design pattern is applicable when the problem can be solved stepwise, and
a single answer or a subset of the input model is returned as a solution. I have applied
the design pattern to find the lowest common ancestor, to compute the equivalent
resistance and to find the shortest path by using Dijkstra’s shortest path algorithm. In this
design pattern, I have used MoTif [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ] as my model transformation language. MoTif has
the modern modeling concepts such as explicit scheduling and rule-based model
transformation. Thus, the formalism I used to represent the design pattern was MoTif-like,
which will be improved to be more general.
        </p>
        <p>A new formalism is needed to represent other design patterns that will be
identified. For that reason, I designed the formalism depicted in Fig. 1. Each design pattern
represents a subset of a regular model transformation solution and can be counted as a
transformation itself. For that reason, the main element in the formalism is a
transformation. The transformation has a list of components and meta-models. The components are
rules, the smallest unit of a transformation, and blocks to support nesting and hierarchy.
Each component is connected with an output class to another component to represent the
control flow of the transformation language. Each rule has some sections e.g., left-hand
side (LHS) as pre-section, right-hand side (RHS) as post-section, when/where clause,
etc. and expressions. Expressions represent the actions to be executed after a rule
application and the constraints to satisfy before/during transformation. Each rule also has
access to variables of the involved modeling languages, which is depicted with abstract
type class. The variables include both the model elements and their attributes. This
formalism assumes the meta-model of each modeling language has a rootType for the types
they provide.
4.2</p>
      </sec>
      <sec id="sec-3-2">
        <title>Expected Contributions</title>
        <p>My contributions will be a list of design patterns for model transformation problems.
This may lead to a bigger output than I expected, so I have filtered some of the categories</p>
        <sec id="sec-3-2-1">
          <title>Output</title>
          <p>1...*</p>
          <p>Component</p>
          <p>*</p>
        </sec>
        <sec id="sec-3-2-2">
          <title>Block</title>
          <p>1...*</p>
        </sec>
        <sec id="sec-3-2-3">
          <title>Section</title>
          <p>1...*</p>
        </sec>
        <sec id="sec-3-2-4">
          <title>Rule</title>
          <p>1</p>
        </sec>
        <sec id="sec-3-2-5">
          <title>Transformation</title>
          <p>*</p>
          <p>Variable *
*
*
*</p>
        </sec>
        <sec id="sec-3-2-6">
          <title>Expression</title>
          <p>1...*</p>
        </sec>
        <sec id="sec-3-2-7">
          <title>Meta-model</title>
          <p>1
*</p>
          <p>Type</p>
        </sec>
        <sec id="sec-3-2-8">
          <title>RootType Pre</title>
        </sec>
        <sec id="sec-3-2-9">
          <title>Post</title>
        </sec>
        <sec id="sec-3-2-10">
          <title>Action</title>
        </sec>
        <sec id="sec-3-2-11">
          <title>Constraint</title>
          <p>
            of design patterns by the model transformation intents. A model transformation intent
is a description of the goal behind the model transformation and the reason for using
it [
            <xref ref-type="bibr" rid="ref7">7</xref>
            ]. Classifying model transformation by intents is of paramount importance when
working on design patterns. It helps target specific patterns for specific use cases and
ensures they are useful in practice. Some of these intents are: manipulation, restrictive
query, refinement, abstraction, translational semantics etc.
          </p>
          <p>Each design pattern will have elements that are describing them. I have used pattern
name, problem, solution and structure elements to describe a design pattern.</p>
          <p>
            Also I am extending the features of our model transformation tool, AToMPM [
            <xref ref-type="bibr" rid="ref8">8</xref>
            ].
AToMPM allows one to model and execute model transformations. It provides a
graphical user interface to define the meta-models of the intended formalisms, to describe
rules graphically as well as control structure for model transformations, and to execute
step-by-step transformations on given models.
I have analyzed the design pattern introduced in [
            <xref ref-type="bibr" rid="ref5">5</xref>
            ] in terms of some quality metrics.
The analysis consists of the following metrics: size of rules, number of rule
applications, and number of auxiliary elements. These metrics will be extended to support a
more reliable and comprehensive evaluation and used in the following quality
framework. In this doctoral research, I initially extended the analysis and created the quality
framework in Fig. 2 by adapting Mohagheghi and Dehlen [
            <xref ref-type="bibr" rid="ref9">9</xref>
            ]’s study to MDE. The
framework has the following steps:
1. Identify quality criteria, such as maintainability and reusability.
          </p>
          <p>Constraints
Relations</p>
          <p>Elements
Metamodel</p>
          <p>have impact on
Quality Criteria</p>
          <p>Correctness
Re-usability
Efficiency
Reliability
Maintainability
Interoperability
...</p>
          <p>...</p>
          <p>Modularity
Size</p>
          <p>Model
measured by
4
...</p>
          <p>Rule Struct.</p>
          <p>Scheduling Struct.</p>
          <p>Languages</p>
          <p>...</p>
          <p>Quality Metric</p>
          <p>Language Independent
Transformation Independent</p>
          <p>Transformation Dependent
2. Identify target objects that have an impact on quality criteria. These objects are
meta-models, models, languages, transformations; i.e., all concepts related to model
transformation.
3. Identify the properties of target objects that have an impact on quality criteria.</p>
          <p>Following the example objects in the previous step, these properties can be
elements, relations, and constraints for meta-models, size, and modularity for models,
scheduling structure, and rule structure of languages.
4. Specify how to evaluate the quality properties. This includes the metrics to be
measured quantitatively or subjective evaluation of the transformation. Other
approaches may be empirical evaluation by interviewing the users or inspections
using checklists.
5. Specify traceability links between quality properties and quality criteria and initiate
the implementation of quality properties and evaluation of metrics. Evaluation of
metrics together with the quality criteria in mind lets the designer which design
pattern is good or bad for a specific purpose and intent.</p>
          <p>Interviewing the users is an effective way to get feedback and identify the effect of
some different technologies in empirical software engineering. This consists of
preparing predefined experiments with scenarios and applying these experiments on the
targeted users. In my case, I am planning to apply some design experiments, which will
consist of finding solutions to some modeling problems, on different set of developers
in modeling community. The experiments may be supported with a questionnares and
surveys at the beginning or at the end. The results of the experiments will lead to more
improvements in the formalism and the design patterns I will identify.
5</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Current Status &amp; Plan</title>
      <p>
        AToMPM is an online modeling and transformation tool [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. Currently, it lets users
design modeling languages, create instances of these languages as models and execute
model transformations over these models. One of its unique features is letting users
do all of these tasks graphically. The overall purpose of this dissertation is to extend
AToMPM in a way that users will specify their model transformation solutions in terms
of the design pattern formalism I provided in Section 4.1. The specification of the model
transformation in the formalism enables users to be independent from any model
transformation language.
      </p>
      <p>
        The main steps are listed below:
– The improvement of the design pattern formalism (Fall 2013): Currently, the
formalism is very similar to the transformation language of AToMPM: MoTif. The
design pattern formalism will be refined to support other popular model
transformation languages, beginning with ATL [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] and QVT [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. Each model transformation
language has its own unique characteristics, so the formalism should be as abstract
as possible to satisfy them.
– The identification of new design patterns (Fall 2013 - Spring 2014): So far, we
have identified one model transformation design pattern [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. Design pattern
identification requires finding the problems in the model transformation design process.
Examples must be investigated carefully to find the recurring problems in existing
model transformation problems. Another way to identify a design pattern is to
focus on single problems and solve them efficiently by adopting different approaches,
which we have applied to three different problems in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. While identifying new
design patterns, categorization with respect to intents will help me to work on a
subset.
– Adapting the existing design patterns (Fall 2013): The existing design patterns,
which the authors call reusable patterns and idioms, will be adapted, analyzed and
represented in the new formalism. This will help me to gather and utilize existing
work.
– Application and generation (Spring 2013 - Spring 2014): AToMPM currently
has MoTif and T-Core [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] as model transformation languages. In AToMPM,
everything is modeled and can be manipulated using model transformations. Therefore,
the solutions designed by users in the design pattern formalism can generate the
results in any model transformation language. This can be realized by using the
higher-order transformation (HOT) feature of AToMPM. By using HOT, users can
not only generate their solutions in intended model transformation language, but
also transform one language to another.
      </p>
      <p>My dissertation touches a subject where the community does not have many studies.
Therefore, an IDE with the ability of inserting design patterns automatically and
generation of these pieces of transformations to a preferred model transformation language
to be a part of a larger solution is expected at the end. A list of newly identified design
patterns will also be available as a part of this project.
6</p>
    </sec>
    <sec id="sec-5">
      <title>Conclusion</title>
      <p>In this document, I gave some details about the field I want to work on in my
dissertation. I believe the design patterns will lead developers to increase their effectiveness
and decrease the time and cost required to solve a model transformation problem. By
using the design pattern catalog, related intents as categories and evaluation of each
design pattern with respect to its purpose and metrics, developers will be able to reduce
the amount of work they need. I also believe the formalism will help the model
transformation community to represent the solutions independent from the specific model
transformation languages. In this doctoral symposium, I hope to receive feedback on
my approach and direction in order to improve the contents and my research focus.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Stahl</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Voelter</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Czarnecki</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <string-name>
            <surname>Model-Driven Software</surname>
          </string-name>
          Development: Technology, Engineering, Management. John Wiley &amp; Sons (
          <year>2006</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Gamma</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Helm</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          , Johnson, R.,
          <string-name>
            <surname>Vlissides</surname>
          </string-name>
          , J.: Design Patterns:
          <article-title>Elements of Reusable Object-Oriented Software. 1 edn</article-title>
          . Addison-Wesley
          <string-name>
            <surname>Professional</surname>
          </string-name>
          (
          <year>November 1994</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Agrawal</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vizhanyo</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kalmar</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shi</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Narayanan</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Karsai</surname>
          </string-name>
          , G.:
          <article-title>Reusable Idioms and Patterns in Graph Transformation Languages</article-title>
          . In: International Workshop on GraphBased Tools. Volume
          <volume>127</volume>
          of ENTCS., Rome, Elsevier (March
          <year>2005</year>
          )
          <fpage>181</fpage>
          -
          <lpage>192</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Iacob</surname>
            ,
            <given-names>M.E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Steen</surname>
            ,
            <given-names>M.W.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Heerink</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          :
          <article-title>Reusable Model Transformation Patterns</article-title>
          .
          <source>In: Proceedings of the Enterprise Distributed Object Computing Conference Workshops</source>
          , Munich, IEEE Computer Society (
          <year>September 2008</year>
          )
          <fpage>1</fpage>
          -
          <lpage>10</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Ergin</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Syriani</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          :
          <article-title>Identification and application of a model transformation design pattern</article-title>
          .
          <source>In: ACM Southeast Conference</source>
          , Savannah,
          <string-name>
            <surname>GA.</surname>
          </string-name>
          (
          <year>April 2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Syriani</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vangheluwe</surname>
          </string-name>
          , H.:
          <article-title>A Modular Timed Model Transformation Language</article-title>
          .
          <source>Journal on Software and Systems Modeling</source>
          <volume>11</volume>
          (
          <year>June 2011</year>
          )
          <fpage>1</fpage>
          -
          <lpage>28</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Amrani</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dingel</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lambers</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lucio</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Salay</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Selim</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Syriani</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wimmer</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Towards a Model Transformation Intent Catalog</article-title>
          .
          <source>In: MoDELS workshop on Analysis of model Transformation</source>
          , IEEE (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Syriani</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vangheluwe</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mannadiar</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hansen</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mierlo</surname>
            ,
            <given-names>S.V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ergin</surname>
          </string-name>
          , H.:
          <article-title>Atompm: A web-based modeling environment</article-title>
          .
          <source>In: MODELS'13 Demonstrations</source>
          . (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Mohagheghi</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dehlen</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          :
          <article-title>Developing a Quality Framework for Model-Driven Engineering</article-title>
          . In Giese, H., ed.:
          <source>Models in Software Engineering. Volume 5002 of Lecture Notes in Computer Science</source>
          . Springer Berlin Heidelberg (
          <year>2008</year>
          )
          <fpage>275</fpage>
          -
          <lpage>286</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Jouault</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Allilaire</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bézivin</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kurtev</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          :
          <article-title>ATL: A model transformation tool</article-title>
          .
          <source>Science of Computer Programming</source>
          <volume>72</volume>
          (
          <issue>1-2</issue>
          ) (
          <year>June 2008</year>
          )
          <fpage>31</fpage>
          -
          <lpage>39</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11. Object Management Group:
          <source>Meta Object Facility</source>
          <volume>2</volume>
          .0 Query/View/Transformation Specification. (jan
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>