<!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>Bridging Java Annotations and UML Profiles with JUMP</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Alexander Bergmayr</string-name>
          <email>bergmayr@big.tuwien.ac.at</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Michael Grossniklaus</string-name>
          <email>michael.grossniklaus@uni-konstanz.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Manuel Wimmer</string-name>
          <email>wimmer@big.tuwien.ac.at</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Gerti Kappel</string-name>
          <email>kappel@big.tuwien.ac.at</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>University of Konstanz</institution>
          ,
          <country country="DE">Germany</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Vienna University of Technology</institution>
          ,
          <country country="AT">Austria</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>UML profiles support annotations at the modeling level. However, current modeling tools lack the capabilities to generate such annotations required for the programming level, which is desirable for reverse engineering and forward engineering scenarios. To overcome this shortcoming, we defined an effective conceptual mapping between Java annotations and UML profiles as a basis for implementing the JUMP tool. It automates the generation of profiles from annotation-based libraries and their application to generate profiled UML models. In this demonstration, we (i) compare our mapping with the different representational capabilities of current UML modeling tools, (ii) apply our tool to a model-based software modernization scenario, and (iii) evaluate its scalability with real-world libraries and applications.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        The value of UML profiles is a major ingredient for model-based software
engineering [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] as they provide features supplementary to the UML metamodel in terms of
lightweight extensions. This powerful capability of profiles can be employed as
annotation mechanism [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], where stereotypes show similar capabilities as annotations in
Java. In the ARTIST project [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], we exploit these capabilities, as we work towards
a model-based engineering approach for modernizing applications by novel cloud
offerings, which involves representing platform-specific models (PSM) that refer to the
platform of existing applications, e.g., the Java Persistence API (JPA)3, when
considering persistence, and the platform of “cloudified” applications, e.g., Objectify4, when
considering cloud datastores. Clearly, the modernization process relies on the
availability of the profiles that correspond to the used Java libraries.
      </p>
      <p>
        Manually developing a rich set of profiles demands a huge effort when
considering the large number of possible annotations in Java. To automate the generation of
UML profiles requires an effective conceptual mapping of the two languages. In recent
work, we defined such a mapping [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] based on which we implemented the JUMP tool.
Hence, we continue with the long tradition of investigating mappings between Java and
      </p>
      <p>
        This work is co-funded by the European Commission, grant no. 317859.
3 http://oracle.com/technetwork/java/javaee/
4 https://code.google.com/p/objectify-appengine/
UML [
        <xref ref-type="bibr" rid="ref7 ref8">7, 8</xref>
        ], though in this work we also consider Java annotations in the mapping.
      </p>
      <p>The JUMP tool is intended to be used by (i) developers that produce
platformspecific profiles to support transformations for reverse engineering and forward
engineering scenarios or to enable platform-independent profiles abstracted from such
platform-specific profiles and (ii) modelers that directly use the produced profiles to
document important design decisions at the modeling level or to easier understand Java
libraries by visualizing provided annotations in terms of UML profile diagrams.</p>
      <p>In this demonstration, we discuss the benefits of JUMP compared to existing
solutions of modeling tools that support annotations. Furthermore, we emphasize the unique
capabilities of the JUMP tool to automatically generate profiles from annotation-based
libraries, which are collected in the UML-Profile-Store. It leverages the generation of
profiled models from applications. To report on the scalability, we measured the
performance of JUMP tool by applying it to large Java code bases.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Bridging Java Annotations and UML: Profiles to the Rescue</title>
      <p>
        UML profiles enable systematically introducing new language elements [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] without the
need to adapt the underlying modeling environment, such as editors, model
transformations, and model APIs [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. UML provides a dedicated language to precisely define
profiles and how stereotypes are applied on models. Similarly, Java provides an
annotation language to declare annotation types that can be applied on the targeted code
elements. Figure 1 demonstrates the relationship between the two languages based on
the Objectify framework. On the left side, the application of annotation types, among
them Cache, to the Customer class and the respective declaration of the Cache
annotation type is shown. The corresponding UML-based representation shown on the
right side demonstrates the stereotype application to the Customer class and the
declaration of Cache by a Stereotype, which is part of the Objectify profile. To ensure
that the Cache stereotype provides at least similar capabilities as the corresponding
annotation type, the extension relationship references the UML meta-class Type. The
Objectify profile generated by the JUMP tool enables modelers to refine UML class
di/* Declaration of Cache */
package com.googlecode.objectify.annotation;
import java.lang.annotation.*;
@Target({ElementType.TYPE})
public @interface Cache {
      </p>
      <p>int expirationSeconds() default 0;
}</p>
      <p>JUMP
JUMP
«profile» Objectify
«metaclass»</p>
      <p>Type
«stereotype»</p>
      <p>Cache
expirationSeconds:Integer = 0 </p>
      <p>«apply»
petstore.domain
«cache, index»</p>
      <p>Customer
«id» custId : Integer
«cache»
expirationSeconds = 600</p>
      <p>Fig. 1: JUMP in Action
agrams towards the Google App Engine (GAE) and supports developers to realize code
generators that produce richer program code.</p>
      <p>
        Mapping Java Annotations to UML. Currently, three significantly different
solutions exist to support Java annotations for UML models: (i) built-in annotation feature
of modeling tools, (ii) generic profile for Java, which enables capturing annotations
and their type declarations, and (iii), profiles which are specific to a Java library or
even an application with custom annotation type declarations. The first solution is
certainly the most tool specific one as it goes beyond Java and UML. It facilitates to
capture Java annotations, though the type declaration of an annotation and its applications
are not connected. A generic profile for Java emulates the representational capabilities
of Java’s annotation language. Although with this approach the connection of
annotation type declarations and their applications can be ensured, the native support of
UML for annotating elements with stereotypes is still neglected. However, stereotypes
specifically defined for annotation types would facilitate their application in a controlled
UML standard-compliant way as they extend only the required UML metaclasses. From
a language engineering perspective, such stereotypes facilitate defining constraints and
model operations, such as model analysis or transformations, because they can directly
be used in terms of explicit types similar to a metaclass in UML. Therefore, the JUMP
tool is based on a mapping between Java’s annotation language and UML’s profile
language [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], which enables the generation of specific stereotypes for corresponding
annotation types that in turn leverage platform-specific profiles.
      </p>
      <p>Existing Modeling Tools. Several commercial and open-source modeling tools
support Java annotations at the modeling level as summarized in Table 1. While all
evaluated modeling tools support the generation of annotated UML class diagrams from Java
applications, none of them is capable of generating profiles for Java libraries, and so
exploiting the powerful capabilities of stereotypes and profiles.</p>
    </sec>
    <sec id="sec-3">
      <title>3 JUMP Tool</title>
      <p>The JUMP tool envisages two main scenarios: UML Profile Generation and Profiled
UML Model Generation. The first scenario is executed on a Java-based Eclipse project
that covers the library from which a profile with the corresponding stereotypes is
generated. Optionally, the generated profile is added to a local copy of the
UML-ProfileStore, which exposes frequently used profiles as plug-ins to facilitate their reuse, thereby
avoiding to regenerate them again and again. The practical application of profiles is
employed in the second scenario, which is integrated into the generation of UML class
diagrams from Java applications. Annotation applications are replaced by the
corresponding stereotypes applied to the reverse-engineered UML elements. The applied
stereotypes are imported from the UML-Profile-Store. If user-defined annotation types
are declared in the application, the respective profile is generated in a pre-processing
step as they need to be defined prior their application. Such application-specific
profiles are provided together with the generated UML class diagram rather than added by
default to the UML-Profile-Store. Similarly to the first scenario, the second scenario is
also executed on Java-based Eclipse projects.</p>
      <p>
        Prototypical Implementation. To realize JUMP, we developed three
transformation chains, i.e., JavaCode2UMLProfile, JavaCode2ProfiledUML, and
ProfiledUML2JavaCode. For injecting Java code to our chains, we reuse MoDisco [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], which
generates a Java model that is considered as input for the JUMP tool. Hence, it can be
considered as a specific model discoverer to extract annotation types from Java libraries
in terms of profiles. To generate Java code from such models we extended the code
generator provided by Obeo Network5. The prototype and the collected profiles from
20 Java libraries with over 700 stereotypes are available at our project web site6.
      </p>
      <p>Scalability Evaluation.To report on the scalability of the JUMP tool, we measured
the execution time of applying the JavaCode2UMLProfile and JavaCode2ProfiledUML
transformation chain to real-world libraries and applications. For obtaining the
measures, we executed them in Eclipse Kepler SR2 with Java 1.7 on commodity hardware:
Intel Core i5-2520M CPU, 2.50 GHz, 8,00 GB RAM, Windows 7 Professional 64 Bit.</p>
      <p>
        Table 2 summarizes our obtained Code Declared Execution
results by emphasizing (i) the num- Library Elements Stereotypes Time in Sec
ber of code elements in the inter- JPA1 20K 84 2.362
bmeerdoiaftedeJcalvaaremdoadnedl,a(pipil)ietdhestneruemo-- SEOpcblrijipenscget6iLfiyn2k7 57400000KKK 1612387 12109...826491224
tcyuptieosn atnidme(si.iiT) hteheramtioenaasulerebdeheixned- Application StAerpepoliteydpes
our selection of libraries (JPA, Ob- Petstore8 10K 287 (12 Profiles) 4.581
jectify, Spring7, and EclipseLink8) DEWS‐Core9 30K 253 (2 Profiles) 3.116
and applications (Petstore9, DEWS- FEicnlidpbsuegLisn1k0 170000KK 17810178  ((33  PPrrooffiilleess)) 12969.6.02208
Core10, Findbugs11, and once more
EclipseLink) is to consider small- Table 2: Performance Measures
sized to large-sized libraries and applications with varying number of declared and
applied stereotypes. Clearly, the size of the input models passed to the transformation
5 http://marketplace.eclipse.org/content/uml-java-generator
6 http://code.google.com/a/eclipselabs.org/p/uml-profile-store
7 http://projects.spring.io/spring-framework
8 https://www.eclipse.org/eclipselink
9 http://oracle.com/technetwork/java/index-136650.html
10 Distant Early Warning System (DEWS), a use-case of the ARTIST project [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]
11 http://findbugs.sourceforge.net
chains has a strong impact on the execution time of the JUMP tool as they are
traversed throughout the generation of profiles and profiled models. Regarding the profile
generation, the number of generated stereotypes is another main factor that impacts on
the execution time. The more stereotypes are generated the more extensions to UML
metaclasses need to be created. For instance, even though the JPA is compared to
Objectify smaller in size the execution time is higher because a lot more transformation
rules are applied when considering the number of declared stereotypes. Similarly, the
number of applied stereotypes and their respective profiles impacts on the execution
time. For instance, in the Petstore application, stereotypes are applied from 12
different profiles, which explains the higher execution time compared to DEWS-Core, even
though the latter is larger in size. Finally, the execution time of generating profiled
models is generally higher compared to profiles because the class structure of the former is
much larger in size compared to the latter. For instance, considering EclipseLink and
the number of generated stereotypes compared to classes the factor is almost 30.
4
      </p>
    </sec>
    <sec id="sec-4">
      <title>Future Work</title>
      <p>The JUMP tool aims at closing the gap between programming and modeling
concerning annotation mechanisms. Still, open challenges remain to further integrate the two
areas. For instance, with the latest Java version (1.8) we have repeating annotations that
enable the same annotation to be repeated multiple times in one place which is currently
not supported by stereotypes in UML. Furthermore, we plan to incorporate the
production of UML activity diagrams for Java method implementations in JUMP in order to
represent also annotation applications on the statement level in UML. Another line of
research we plan to investigate is to further evaluate the JUMP tool in the context of
the ARTIST project by empirical studies with our use case providers to determine the
practical benefits for understanding and migrating legacy applications.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>A.</given-names>
            <surname>Bergmayr</surname>
          </string-name>
          et al.
          <article-title>Migrating Legacy Software to the Cloud with ARTIST</article-title>
          .
          <source>In Proc. of CSMR</source>
          , pages
          <fpage>465</fpage>
          -
          <lpage>468</lpage>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>A.</given-names>
            <surname>Bergmayr</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Grossniklaus</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Wimmer</surname>
          </string-name>
          , and
          <string-name>
            <surname>G. Kappel.</surname>
          </string-name>
          <article-title>JUMP-From Java Annotations to UML Profiles</article-title>
          .
          <source>In Proc. of MODELS</source>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>M.</given-names>
            <surname>Brambilla</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Cabot</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M.</given-names>
            <surname>Wimmer</surname>
          </string-name>
          .
          <article-title>Model-Driven Software Engineering in Practice</article-title>
          . Morgan&amp;Claypool,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>H.</given-names>
            <surname>Bruneliere</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Cabot</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Jouault</surname>
          </string-name>
          , and
          <string-name>
            <given-names>F.</given-names>
            <surname>Madiot</surname>
          </string-name>
          .
          <article-title>MoDisco: A Generic and Extensible Framework for Model Driven Reverse Engineering</article-title>
          .
          <source>In Proc. of ASE</source>
          , pages
          <fpage>173</fpage>
          -
          <lpage>174</lpage>
          ,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5. L.
          <string-name>
            <surname>Fuentes-Fernández</surname>
            and
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Vallecillo</surname>
          </string-name>
          .
          <article-title>An Introduction to UML Profiles</article-title>
          .
          <source>European Journal for the Informatics Professional</source>
          ,
          <volume>5</volume>
          (
          <issue>2</issue>
          ):
          <fpage>5</fpage>
          -
          <lpage>13</lpage>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>P.</given-names>
            <surname>Langer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Wieland</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Wimmer</surname>
          </string-name>
          , and
          <string-name>
            <surname>J. Cabot. EMF</surname>
          </string-name>
          <article-title>Profiles: A Lightweight Extension Approach for EMF Models</article-title>
          .
          <source>JOT</source>
          ,
          <volume>11</volume>
          (
          <issue>1</issue>
          ):
          <fpage>1</fpage>
          -
          <lpage>29</lpage>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>U.</given-names>
            <surname>Nickel</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Niere</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Zündorf</surname>
          </string-name>
          .
          <article-title>The FUJABA Environment</article-title>
          .
          <source>In Proc. of ICSE</source>
          , pages
          <fpage>742</fpage>
          -
          <lpage>745</lpage>
          ,
          <year>2000</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>R. F.</given-names>
            <surname>Paige</surname>
          </string-name>
          and
          <string-name>
            <given-names>L. M.</given-names>
            <surname>Rose</surname>
          </string-name>
          . Lies,
          <article-title>Damned Lies and UML2Java</article-title>
          . JOT,
          <volume>12</volume>
          (
          <issue>1</issue>
          ),
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>B.</given-names>
            <surname>Selic</surname>
          </string-name>
          .
          <article-title>The Less Well Known UML: A Short User Guide</article-title>
          .
          <source>In Proc. of SFM</source>
          , pages
          <fpage>1</fpage>
          -
          <lpage>20</lpage>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>