<!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>DSLFORGE: Textual Modeling on the Web</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Amine Lajmi</string-name>
          <email>amine.lajmi@dslforge.com</email>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Jabier Martinez</string-name>
          <email>jabier.martinez@uni.lu</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Tew k Ziadi</string-name>
          <email>tewfik.ziadi@lip6.fr</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>LIP6, Universite Pierre et Marie Curie</institution>
          ,
          <addr-line>Paris</addr-line>
          ,
          <country country="FR">France</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>SnT, University of Luxembourg</institution>
          ,
          <country country="LU">Luxembourg</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Software Architect</institution>
          ,
          <addr-line>Paris</addr-line>
          ,
          <country country="FR">France</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>The use of Model-Driven Engineering in software development is increasingly growing in industrial applications as the technologies are becoming more mature. In particular, domain-speci c languages bring to end-users simplicity of use and productivity by means of various artifacts generators. However, end-users still need to cope with heavy modeling infrastructures and complex deployment procedures, before being able to work on models. In this paper, we propose a centralized lightweight approach for performing textual modeling through web browsers. DSLFORGE is a generator of online text editors. Given a language grammar, the tool allows to generate lightweight web editors, supporting syntax highlighting, syntax validation, scoping, and code completion. DSLFORGE allows also automatic integration of existing code generators into the generated web editor providing a complete online modeling user experience. Demo: http://youtu.be/KN6cneWhhKY</p>
      </abstract>
      <kwd-group>
        <kwd>textual modeling</kwd>
        <kwd>online editor</kwd>
        <kwd>model-driven engineering</kwd>
        <kwd>domain-speci c languages</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        Domain-Speci c Languages (DSL) [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] let end-users feel the advantages of using
domain abstractions instead of general-purpose language constructs. Therefore,
Model-Driven Engineering (MDE) is gaining more success in industrial
applications as the available methods and tools are becoming more mature. Modeling
technologies have made big steps towards better integration and simplicity of use
and, as a consequence, domain-speci c standards have met great success within
multiple communities (e.g. Modelica [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ], AUTOSAR [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], and SysML [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ]).
      </p>
      <p>
        However, end-users still need to cope with heavy development
infrastructures and complex deployment procedures when it comes to using modeling
tools. This is because most of the existing tools are based on general purpose
Integrated Development Environments (IDEs) such as Eclipse or MPS, or
standalone proprietary applications as MetaEdit+ [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. Indeed, in most of the tools,
whether bundled into standalone Rich Client Platforms (RCP), or packaged
separately as individual features, both Tooling and Runtime need to run on top of
heavy infrastructures. The deployment of modeling tools is still a tedious task for
non-developers and goes sometimes against the adoption of DSLs in enterprises.
Indeed, there is a lack of practical solutions, lightweight and easy-to-deploy.
Moreover, modeling resources, as any kind of software resources today,
experience an increasing demand to be accessed using di erent devices such as tablets
and smartphones and from any place in the world at any time.
      </p>
      <p>In this paper, we present the DSLFORGE tool, as support of a lightweight
centralized approach that allows end-users to edit and process textual models
through web browsers. The paper is organized as follows: Section 2 describes
current web-based approaches and Section 3 presents the DSLFORGE tool, its
methodology of use, two functional examples and its internal architecture.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Modeling in the web</title>
      <p>
        There are still technological challenges to achieve modeling on the web.
Nevertheless, some initiatives targeting graphical languages are worth to notice.
GenMyModel [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] allows end-users to create UML diagrams and launch artifacts
generation. AToMPM [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ] is an online graphical modeling environment, which
uses a subset of UML for the de nition of modeling languages and renders model
elements in SVG. GEFGWT [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] allows to build graphical editors based on GEF
and could be the basis for porting GMF on the web. Also, the Eclipse-based
Remote Application Platform (RAP) [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] makes easier to port Rich Client
Applications (RCP) [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] to the web, since most of the SWT [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ] libraries are
transparently handled by the framework. RAP-based EMF editors have been provided
in tools like EMF on Rails [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] or MUVITORKIT [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]. They are based on the
tree viewer and a properties page o ering limited user experience when a textual
representation is more appropriate.
      </p>
      <p>
        Few tools provide exible means to de ne textual languages and they come
with in-house formalisms. For example, in Concrete Editor [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], models are
represented by DOM nodes with speci c CSS classes. An Xtext-based online editor
has been also prototyped [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. This prototype, which is based on Orion [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ], was
proposed as an initial exploration on the feasibility of online textual editors. It
allows editing EMF resources online but the main part of resource processing
is done on the server. Within the server, each service (e.g. syntax highlighting,
content assist, hover, etc.) is held by a dedicated servlet asynchronously, and the
entire document is sent to the server and back again to the client at each user
interaction, leading to serious performance issues. Moreover, neither methodology
nor tool has been provided to show how one could bring a DSL to the web.
Processing EMF-based DSL resources intensively on the client side is not reasonable
also, as one has to port the entire Eclipse workbench to JavaScript. The frontier
of what should be done on the client side against what should be done on the
server side is an open question. DSLFORGE resource processing is distributed
between the client and the server. We take advantage of two open-source
technologies which are RAP and ACE [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. The integration with RAP allows the easy
integration with standard widgets such as le system navigators, le uploaders,
forms, etc.
      </p>
    </sec>
    <sec id="sec-3">
      <title>DSLFORGE</title>
      <p>DSLFORGE is a framework for the generation of web textual DSL editors. The
generated editors are packaged into workbench web applications which let users
create, edit, and launch transformations from models online, making it
possible to work simultaneously with partners or colleagues on the same resources.
These online editors are also easily customizable and extensible. DSLFORGE
is proposed to two main categories of users: (i) DSL developers, and (ii) DSL
users. The former is given a technology to build and publish online editors on the
web. The latter uses the DSL editor through lightweight applications (enterprise
intranet, mobile devices, tablets, etc.).
3.1</p>
      <sec id="sec-3-1">
        <title>Methodology</title>
        <p>The framework is packaged into two features: Tooling and Runtime. DSL
developers use the Tooling which contains all the needed components to generate and
deploy the editor on application servers. The steps below are followed iteratively
by DSL developers to get an operational online editor:
1. Design/enhance the DSL
2. If applicable, design/enhance transformations to generate some kind of
artifacts from DSL instances
3. Automatically generate from the grammar the RCP and the RAP editor
4. If needed, enhance the web editor generated code. Third party plugins could
provide extra functionalities.
5. Automatically package and deploy the editor.</p>
        <p>DSL users use the deployed editor to edit and process models online, namely
they can: create, edit and save models, trigger code generation from a model,
and execute other actions or functionalities if the web editor was extended by
third party plugins.
3.2</p>
      </sec>
      <sec id="sec-3-2">
        <title>Examples</title>
      </sec>
      <sec id="sec-3-3">
        <title>Generating a State Machine web editor: As a rst example, we use the</title>
        <p>Martin Fowler's state machine example provided by Xtext. The example comes
with a grammar allowing textual speci cation of state machines. Our objective
is to provide a web editor that allows modeling state machines and generating
java test classes from these state machines on the server using the browser. An
extra functionality should be integrated for compiling and executing the test
classes through the browser too.</p>
        <p>Using DSLFORGE, as shown in Figure 1, we select the Xtext grammar to
generate its online editor. At this moment we are able to select the existing
transformations that will be available online for end-users. In this case, we select the
existing state-machine to java transformation. The online editor is automatically
packaged into a web application, together with a workspace navigator.</p>
        <p>To execute the web application we launch the browser. Figure 2 shows how
the editor handles syntax validation, content assist and how the web
application is enhanced with a code generation action contributed to the Tools menu.
Semantic highlighting, scoping, history management (undo/redo), key bindings
and folding are also supported by default. In addition, a custom action is
integrated to the web application for compiling and executing Java classes on the
server, to show an example of the online editor extensibility.</p>
        <p>A web editor for the speci cation of conference websites: As a second
example, we use DSLFORGE in the context of a conference DSL. This DSL
allows end-users, who are not necessarily HTML/JavaScript experts, to generate
and update on the server the conference or workshop website. This way, they
can update the conference website wherever they are and without knowing the
website technical details.
3.3</p>
      </sec>
      <sec id="sec-3-4">
        <title>Architecture</title>
        <p>The Tooling feature is shipped with Xtext, EMF, and ANTLR development
features, and contains the editor generator and other contributed plugins which may
be integrated with the editor into online workbenches (e.g. workspace navigator,
authentication, le uploader). The Runtime contains the standard RAP target
platform together with EMF target components, Xtext runtime, and additional
plugins used during the execution of the editor. The editor can be integrated
with any third party RAP-compatible plugin.</p>
        <p>DSLFORGE follows the RAP standard architecture and lifecycle. Indeed,
each generated editor widget has its counterpart in JavaScript. Resource
processing is dispatched between the server and the client. The communication
between the client and the server uses the JSON format. Multi-threading is used
on the client side to handle the computationally expensive resource processing.
Indeed, dedicated workers parse the user input and feed-back the UI with
annotations. Shared workers are used to manage the global index which maintains
available the cross references to all editors opened within the same user session.
On the server side, parsing and validation is triggered when saving the resource.
Asynchronous server pushes are used to notify the client about workspace change
events and server-side resource validation. The generated web applications have
been successfully deployed on two application servers (Tomcat and Jetty).
Future work will include securing the communication between the client and the
server and enhancing the management of resource access privileges.</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1. Ace: Ace, Cloud 9
          <string-name>
            <surname>IDE</surname>
          </string-name>
          (
          <year>2014</year>
          ), http://ace.c9.io
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>AUTOSAR: AUTomotive Open System Architecture</surname>
          </string-name>
          (
          <year>2014</year>
          ), http://autosar.org
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3. ConcreteEditor: Concrete Editor (
          <year>2014</year>
          ), http://concrete-editor.org
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Dirix</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Muller</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Aranega</surname>
          </string-name>
          , V.:
          <article-title>GenMyModel: An Online UML Case Tool</article-title>
          . In: ECOOP (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Eysholdt</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Behrens</surname>
          </string-name>
          , H.:
          <article-title>Xtext: implement your language faster than the quick and dirty way</article-title>
          . In: SPLASH/OOPSLA Companion. pp.
          <volume>307</volume>
          {
          <issue>309</issue>
          (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6. GEFGWT:
          <article-title>GEF in the web browser (</article-title>
          <year>2014</year>
          ), http://www.gefgwt.org
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Lange</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>Eclipse Rich Ajax Platform: Bringing Rich Client to the Web</article-title>
          . Apress, Berkely, CA, USA,
          <volume>1</volume>
          <fpage>edn</fpage>
          . (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Lopez-Landa</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Noguez</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Guerra</surname>
          </string-name>
          , E.,
          <string-name>
            <surname>de Lara</surname>
            ,
            <given-names>J.:</given-names>
          </string-name>
          <article-title>EMF on Rails</article-title>
          .
          <source>In: Proc. ICSOFT</source>
          . pp.
          <volume>273</volume>
          {
          <issue>278</issue>
          (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>McA</surname>
            <given-names>er</given-names>
          </string-name>
          , J.,
          <string-name>
            <surname>Lemieux</surname>
            ,
            <given-names>J.M.</given-names>
          </string-name>
          : Eclipse Rich Client Platform: Designing, Coding, and
          <article-title>Packaging Java(TM) Applications</article-title>
          . Addison-Wesley
          <string-name>
            <surname>Professional</surname>
          </string-name>
          (
          <year>2005</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Mernik</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Heering</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sloane</surname>
            ,
            <given-names>A.M.</given-names>
          </string-name>
          :
          <article-title>When and How to Develop Domain-speci c Languages</article-title>
          .
          <source>ACM Comput. Surv</source>
          .
          <volume>37</volume>
          (
          <issue>4</issue>
          ),
          <volume>316</volume>
          {344 (Dec
          <year>2005</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11. MetaCase: MetaEdit+ (
          <year>2014</year>
          ), http://www.metacase.com/
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Modica</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Biermann</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ermel</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>An Eclipse Framework for Rapid Development of Rich-featured GEF Editors based on EMF Models</article-title>
          .
          <source>In: GI Jahrestagung</source>
          (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Northover</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          , Wilson,
          <string-name>
            <surname>M.:</surname>
          </string-name>
          <article-title>SWT: The Standard Widget Toolkit</article-title>
          , Volume
          <volume>1</volume>
          .
          <string-name>
            <surname>Addison-Wesley</surname>
            <given-names>Professional</given-names>
          </string-name>
          , rst edn. (
          <year>2004</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Orion: Orion Project</surname>
          </string-name>
          (
          <year>2014</year>
          ), http://www.eclipse.org/orion
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>Saldamli</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fritzson</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Aronsson</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bunus</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Engelson</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Johansson</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          , Karstrom, A.:
          <article-title>The Open Source Modelica Project</article-title>
          .
          <source>In: Proc. Modelica Conf. Modelica Association</source>
          (
          <year>2002</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <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>
          . In: Demos/Posters/StudentResearch@MoDELS. pp.
          <volume>21</volume>
          {
          <issue>25</issue>
          (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <surname>SysML: Systems Modeling Language</surname>
          </string-name>
          (
          <year>2014</year>
          ), http://www.uml-sysml.org
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>