<!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-based Reengineering of User Interfaces</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Andreas Wolff</string-name>
          <email>Andreas.Wolff@informatik.uni-rostock.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Peter Forbrig</string-name>
          <email>pforbrig@informatik.uni-rostock.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>University of Rostock Institute of Computer Science Albert Einstein Str.</institution>
          <addr-line>21, 18059 Rostock</addr-line>
          ,
          <country>Germany [Andreas.Wolff</country>
        </aff>
      </contrib-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        INTRODUCTION
During the last years a number of approaches were
proposed of how to design and create software and user
interfaces in a model-based manner. Many of them can only
be used for newly designed projects. Figure 1 gives an
impression of the general idea of this model-based UI
development process. Details on those tools and
methodology are for example found in [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ].
      </p>
    </sec>
    <sec id="sec-2">
      <title>Domain</title>
    </sec>
    <sec id="sec-3">
      <title>UI/Application</title>
      <p>Figure 1 sketches a generally agreed principle of
modeldriven user interface development (MD-UID) for
singlemodal UIs. A connection from “UI/Application” back
to “Concrete UI” was omitted deliberately, as we don't
consider UI-reengineering to be part of the general
approaches.</p>
      <p>It is a problem to apply the model-driven development
(MDD) to already existing software systems. We aim to
open MDD for legacy software as well. In this paper an
approach is presented of how to extract a model of an
application's user interface from the application itself. We
start bottom-up by extracting a model of its concrete user
interface (CUI). This model can be abstracted into an
abstract user interface (AUI). While abstracting,
connections to business logic and object model are
preserved. Object model thereby refers to the
classdefinitions of runtime objects. Figure 2 illustrates the
general idea of our reengineering process. Dotted lines
denote references, solid lines show the process flow.</p>
    </sec>
    <sec id="sec-4">
      <title>Models</title>
    </sec>
    <sec id="sec-5">
      <title>CUI (orig)</title>
    </sec>
    <sec id="sec-6">
      <title>Legacy</title>
    </sec>
    <sec id="sec-7">
      <title>Software</title>
    </sec>
    <sec id="sec-8">
      <title>Object Models</title>
    </sec>
    <sec id="sec-9">
      <title>Business Logic AUI XUL XUL</title>
    </sec>
    <sec id="sec-10">
      <title>CUI (reeng.) Reengineered UI</title>
      <p>By using AUI and CUI models we can transform and adapt
the user interface to change appearance or concept, or to
apply HCI patterns. Since we keep business-logic and
object-model references, a generated user-interface from
these models ought to be able to interact with the original
software. In practice, we currently only are able to perform
this process for very basic applications and in a restricted
environment.</p>
      <p>A lot of our tools are based on XUL and written in Java.
This also applies to the reengineering tool-set. Hence this
tool-set was intentionally planned to only examine and
regenerate Java-Swing applications. We don't consider this as
a confining restriction, but rather as a necessary
simplification to actually deliver a sizeable
proof-ofconcept application in appreciable time.</p>
      <p>
        Comparable work of extracting user interface models from
existing applications and reengineering was also done by
Vanderdonckt et. al. [
        <xref ref-type="bibr" rid="ref8 ref9">8,9</xref>
        ]. They focussed on web-pages and
applications written in the programming language C(++).
Other related work was done by Mainetti et.al. [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. They
are focussing on the redesign of web applications, also
including code analysis to derive object models and
business logic.
      </p>
      <p>
        To assist the reengineering of character based user
interfaces to graphical user interfaces a model based
approach was proposed by Tucker and Stirewalt [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]. It
focusses on batch-command systems and utilizes an
intermediate model comparable to data flow diagrams to
determine required user input and application flow. It seems
to have been abandoned though.
      </p>
      <p>
        Another of our main research topics is to integrate HCI
patterns into MDD. Object oriented design patterns, as
introduced by Gamma et. al., are considered as valuable aid
in software development. We expect comparable benefit of
HCI patterns as well and therefore try to integrate those
patterns into our model-based UI development process.
The main principle to achieve this is to translate HCI
patterns into machine-readable attributed components when
and where appropriate. We call these components “pattern
instance components (PIC)” [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] as they contain an instance
of their respective pattern. PICs are used to
semiautomatically transform parts of abstract or concrete
interfaces to follow a certain pattern.
      </p>
      <p>
        Arnout's [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] research on object-oriented pattern components
inspired our proceeding, which is e.g. described in [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
EXTRACTING USER INTERFACE MODELS
To extract UI models from Java applications a tool
“Swing2XUL” is under development. Swing2XUL is a
wrapper application. It registers listeners for any frame that
is instantiated by a running application. By entering a
special keyboard command it converts the contents of any
currently active frame to XUL [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], see figures 3 and 4 for
an example.
      </p>
      <p>
        Our demonstration application is simple. It has two labelled
input fields for entering first name and surname. On
pressing “Propose User Id” a new string is calculated by
concatenating the first three letters of both name parts.
Afterwards this string is converted into lower-case form and
presented as “User-Id” in its own text field.
Figure 4 depicts how SeaMonkey's Gecko engine interprets
Swing2XUL's parsing result of the frame shown in figure 3.
We consider this XUL result as CUI of our application.
Taking it as input we are able to derive an AUI of this
application in an UIML [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] related dialect. See USGP in
[
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] for details, we do not want to discuss that matter in this
paper.
      </p>
      <p>BUSINESS LOGIC AND OBJECT MODEL
Converting a Swing-UI to a similar looking XUL-UI is not
difficult. Major problem is to get an object-model and keep
the linkage from UI elements to that. Those references are
needed later to synthesize a running application.</p>
      <p>
        In a simple first attempt we tried to make use of XMI-UML
models, generated from an application's Java source code
by ArgoUML [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
Swing2XUL, per introspection, can identify the
runtimeclass of any triggered action and displayed object and by
that connect it to our object-model. Such a reference
basically is a pointer to an element within our XMI-UML.
This information, i.e. the detected reference, is stored into
our generated XUL-GUI. It is stored as an attribute, within
an own namespace, in its respective XUL-element.
For the purpose of reengineering our sample application the
relevant references would point 1) to an action to calculate
a user id and 2) to a close action. Both are annotated within
their XUL button elements.
      </p>
      <p>Check boxes, radio button and menus are handled in a
similar manner. More complex references are needed for
tables and trees to consider their respective internal models,
renderers and editors.</p>
      <p>REENGINEERING
At this point we have a concrete user interface and our
object-model. Thus the reverse engineering of our sample
application, with respect to model based development, was
successful.</p>
      <p>We now are able to rearrange the user interface of our
sample application and to generate a new running
application with a different UI from that.</p>
      <p>
        Assuming that usability testing has shown that users want
more guidance through the application, we decided to apply
the “Wizard” pattern [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] to it. This is a semi-automatic
process.
      </p>
      <p>A human designer has to decide which elements of the UI
are to put in each single wizard page and also their
sequence.</p>
      <p>
        Application of patterns to a concrete user interface and
editing of XUL based CUI specifications is done by a
specialized editor named XUL-E [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
      </p>
      <p>PICs form the basis of pattern application. As mentioned
before these are components consisting of transformation
rules. Those rules allow the modification of concrete user
interfaces in XUL based on an abstract model description,
in this case “Wizard's” details.</p>
      <p>An application of PIC “Wizard” generates a number of
views, or pages, that are interconnected by “Next”, “Prev”
and “Finish” controls.</p>
      <p>Sequence and content of pages are determined by multiple
area selections and their sequence. This is an interactive
process. At first one draws a selection rectangle around the
planned content for page one, afterwards one draws another
selection rectangle around the future content of page two,
etc.</p>
      <p>This resulting CUI can be edited as in any other UI editor.
The third view, counted top-down, does not meet our
requirements and will be edited.
It was modified manually by removing “Next” and “Finish”
buttons and moving the buttons from the original
application into their positions. This results in a user
interface as shown in figure 7 for that wizard page.
GENERATING THE REENGINEERED APPLICATION
Our new user interface is still only displayable by XUL
interpreters and it is not possible for them to interact with
the original application.</p>
      <p>We now need to generate a Java GUI that resembles our
designed CUI and re-establishes connections to business
logic and object-model.
now we ourself created a small XUL to Java code
generator, by using the interpreter engine of XUL-E. In this
way it was easier to attach hooks for the original
application's source code.</p>
      <p>However, our code generator merges the newly designed
CUI with object-model and business logic. It compiles the
resulting source code and creates a new application that
behaves like the original but with a different user interface.
Figure 8 is a screenshot of our new application, a user id
“karmül” for “Karl-Heinz Müller” was generated.
CONSTRAINTS
Presently our approach is not general enough to meet
requirements of real-world applications. It requires the
current GUI of an application to completely obey the
Model-View-Controller concept of Swing, which most
Java/Swing applications do not. If any data object or any
part of business logic has associations to UI elements our
approach eventually fails.</p>
      <p>Also issues of technical nature do exist. For example
threading and introspection done by the application itself.
Another noteworthy constraint is to have an applications
source code, respectively its UI relevant part. In most cases
this limitation can be overcome by using Java decompilers.
SUMMARY &amp; FURTHER WORK
We briefly reported on our ongoing work in the field of
model-based reengineering of already existing,
non-modelbased developed, applications.</p>
      <p>The basic idea is to 1) derive a CUI from a running
application, 2) derive its object-model and business-logic
via its source code and 3) keep connections of CUI
elements to those models of step 2. Using those models we
can redesign the user interface and regenerate a functional
application thereof. A short sample of this process, utilizing
a pattern instance component, was presented.</p>
      <p>Further work needs to be done to map more Swing
components to XUL, most importantly trees and tables.
And in doing so being able to derive more complex CUIs.
Also some of the current constraints need to be resolved.
Language:</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Arnout</surname>
          </string-name>
          , Karine: From Pattern to Components,
          <source>PhD dissertation</source>
          , Swiss Institute of Technology,
          <source>Zurich 2004</source>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Wolff</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Forbrig</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Dittmar</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Reichart</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>Tool Support for an Evolutionary Design Process using Patterns</article-title>
          ,
          <source>Proc. of Workshop on Multi-channel Adaptive Context-sensitive Systems</source>
          <year>2006</year>
          , Glasgow, GB, p.
          <fpage>71</fpage>
          -
          <lpage>80</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Müller</surname>
          </string-name>
          , Andreas: Spezifikation geräteunabhängiger Benutzerschnittstellen durch Markup-Konzepte,
          <source>PhD dissertation</source>
          , University of Rostock,
          <year>2003</year>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>Wizard</given-names>
            <surname>Pattern</surname>
          </string-name>
          , http://designinginterfaces.com/Wizard
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>5. ArgoUML, http://argouml.tigris.org</mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          <article-title>6. XUL XML User Interface http</article-title>
          ://www.mozilla.org/projects/xul
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Rathsack</surname>
          </string-name>
          , Wolff, Forbrig:
          <article-title>Using HCI-Patterns with Model-based Generation of Advanced User-Interfaces</article-title>
          ,
          <source>Proc. of MDDAUI</source>
          <year>2006</year>
          ,
          <article-title>Models 2006</article-title>
          , Genova, Italy
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>J.</given-names>
            <surname>Vanderdonckt</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Bouillon</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Souchon</surname>
          </string-name>
          ,
          <article-title>Flexible Reverse Engineering of Web Pages with VAQUITA</article-title>
          ,
          <source>in Proceedings of IEEE 8th Working Conference on Reverse Engineering WCRE'2001 (Stuttgart</source>
          ,
          <fpage>2</fpage>
          -
          <lpage>5</lpage>
          october
          <year>2001</year>
          , IEEE Press, Los Alamitos,
          <year>2001</year>
          , pp.
          <fpage>241</fpage>
          -
          <lpage>248</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>L.</given-names>
            <surname>Bouillon</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Vanderdonckt</surname>
          </string-name>
          , J. Eisenstein, ModelBased Approaches to Reengineering Web Pages,
          <source>in Proceedings of 1st International Workshop on Task Models</source>
          and
          <article-title>Diagrams for user interface design TAMODIA'</article-title>
          <year>2002</year>
          ,
          <string-name>
            <given-names>INFOREC</given-names>
            <surname>Printing</surname>
          </string-name>
          <string-name>
            <surname>House</surname>
          </string-name>
          , Bucharest,
          <year>2002</year>
          , pp.
          <fpage>86</fpage>
          -
          <lpage>95</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Pleuß</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          , Van den Bergh, J.,
          <string-name>
            <surname>Hußmann</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sauer</surname>
            ,
            <given-names>S</given-names>
          </string-name>
          and Boedcher,
          <string-name>
            <surname>A</surname>
          </string-name>
          .(Eds.).
          <source>MDDAUI '06, Proc. of the MoDELS'06 Workshop on Model Driven Development of Advanced User Interfaces</source>
          ,
          <source>CEUR Workshop Proc. 214. CEUR-WS.org</source>
          ,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Mainetti</surname>
            , Paiano,
            <given-names>Pandurini:</given-names>
          </string-name>
          <article-title>User-Centered reverse engineering: Genesis-D project</article-title>
          ,
          <source>in proceedings of Web Maintenance and Reengineering</source>
          <year>2006</year>
          ,
          <source>CEUR Workshop Proc. 193</source>
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>UIML</surname>
          </string-name>
          , User http://www.uiml.org
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Tucker</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Stirewalt</surname>
          </string-name>
          , R.:
          <article-title>Model based userinterface reengineering</article-title>
          ,
          <source>in Proc. 6th WCRE</source>
          ,
          <year>1999</year>
          . http://citeseer.ist.psu.edu/tucker99model.html
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>