<!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>clooca : Web based tool for Domain Speci c Modeling</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Shuhei Hiya⋆</string-name>
          <email>hiya@f.ait.kyushu-u.ac.jp</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Kenji Hisazumi</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Akira Fukuda</string-name>
          <email>fukuda@f.ait.kyushu-u.ac.jp</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Tsuneo Nakanishi</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Kyushu University 744 Motooka Nishi-ku</institution>
          ,
          <addr-line>Fukuoka 819-0395</addr-line>
          ,
          <country country="JP">Japan</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Clooca is a development environment that allows us to build up domain-speci c modeling languages, or DSMLs, and their code generators. DSMLs are widely used to improve productivity and quality of developing software to raise the level of abstraction and to generate a fully functional software codes. Currently some tools to develop software are provided as web services. We can use the tool without installing any software and without professional knowledge of software development. Even domain specialists who do not know how to develop software can use it. Therefore, we tackle with developing software-as-a-service(SaaS) type of DSML tools to bring bene ts of both DSML and SaaS type of development tools. We chose to use clooca in an education setting, because this tool solves some problems in that eld. The youtube link is http://www.youtube.com/watch?v=VS5VNB0YA_o.</p>
      </abstract>
      <kwd-group>
        <kwd>Domain-Speci c-Modeling</kwd>
        <kwd>DSML</kwd>
        <kwd>SaaS</kwd>
        <kwd>Code Generator</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        Clooca is a development environment that allows us to build up domain-speci c
modeling languages (DSMLs), and their code generators. Clooca is provided as
a service, similar to Gmail. Clooca is simple to use: open a web browser that
supports HTML5 and JavaScript, input the URL of clooca, and start using it.
Instllation and setup are not required. DSMLs are widely used to improve the
productivity and quality of developing software[
        <xref ref-type="bibr" rid="ref1">1</xref>
        ][
        <xref ref-type="bibr" rid="ref2">2</xref>
        ][
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. Clooca raises the level of
abstraction rather than describing programming languages. By describing these
abstract models, clooca allows domain specialists to develop software without
knowledge of how to develop software using a programming language. The tool
can generate fully functional codes from these models. We used clooca in a
software modeling education setting.
      </p>
      <p>Education can derive many bene ts from using a development tool as a web
service. In software modeling courses, many students use modeling tools, which
are time consuming to install. As an alternative, teachers can use clooca to
eliminate the need for students to install the tools and professional knowledge of
software development. In addition, teachers and students can share and analyze
their model in real time on clooca.</p>
      <p>DSML tools has two bene ts in the education eld. First, It raises the level
of abstraction rather than describing programming languages. Thus, teachers
can de ne a modeling language according to each student's level of ability.
Second, because DSML tool can generate fully functional codes from these models,
students can execute the model soon after draw it, and they can check how the
model works.</p>
      <p>The remainder of this paper is organized as follows. We discuss the
architecture of the clooca and its implementations in Section 2. In Section 3, we
demonstrate the clooca in a real usage scenario. We conclude this paper in
Section 4.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Implementation of clooca</title>
      <p>
        JavaScript Object Notation-Based Model Representation We identify
requirements for the scheme of DSML de nition for a SaaS type of DSML tool
as follows. The model representation of the scheme should be easy to serialize
and deserialize. The model must be serialized and transferred between a web
browser and a server, because clooca is a web browser-based tool. The serialized
form should be used on many platforms used by constructing web services (e.g.,
JavaScript, Python, PHP, and Ruby). We are able to serialize and deserialize
the model without compiling or generating any stubs. The system should be able
to deal with these models dynamically. The scheme allows us to de ne DSMLs
easily. The representation of the model should not be complicated. The model
should be de ned not only by the tools, but also by hand. In other words, the
representation form of the model should be human readable. Figure 1 shows a
DSML model. An extract of JavaScript Object Notation (JSON) [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] expression
of the DSML model is shown in Figure 2.
      </p>
      <p>Clooca architecture Figure 3 shows the architecture of clooca, which consists
of a server and a client. The clooca server runs on web servers such as Apache and
has functions to load and store models and meta-models according to requests
from the clooca client. It is a kind of database wrapper. We employ JavaScript
to implement the server. The clooca client runs on web browsers that support
HTML5 and JavaScript such as Google Chrome. It consists of the workbench and
the model editor, shown in Figure 4 and Figure 5, respectively. The workbench
is a tool to de ne DSLs and to develop code generators. The model editor is a
tool to edit concrete DSLs.</p>
      <p>Workbench The workbench is a tool to de ne DSMLs and to develop code
generators. Figure 4 shows a screenshot of the clooca workbench. It is quite
complicated to de ne a DSML to describe a JSON description. However, with the
! "#$%&amp;'&amp;()*"+,*--%,(.</p>
      <p>/+#+%/&amp;'&amp;!
/0&amp;'&amp;!
/,12,#"/3+3*"/&amp;'&amp;!
+0&amp;'&amp;!</p>
      <p>+#,4%+&amp;'&amp;(/+#+%/5/6(.</p>
      <p>&lt; &lt; %7%"+&amp;'&amp;(89++*"&amp;+*91:%;(
&lt;.
/6&amp;'&amp;!
"#$%&amp;'&amp;(=9""3"4&amp;&gt;+#+%(.
#1+3*"&amp;'&amp;(?*&amp;@*,A#,;(.
/,12,#"/3+3*"/&amp;'&amp;!
+6&amp;'&amp;!</p>
      <p>+#,4%+&amp;'&amp;(/+#+%/5/B(.</p>
      <p>&lt; &lt; %7%"+&amp;'&amp;(A:3+%&amp;;%+%1+%;(
&lt;.
/B&amp;'&amp;!</p>
      <p>"#$%&amp;'&amp;(@3"3/:&amp;&gt;+#+%(.</p>
      <p>
        &lt; &lt; &lt; #1+3*"&amp;'&amp;(&gt;+*C(.
workbench, we can de ne DSMLs using a graphical user interface (GUI), rather
than describing the JSON description mentioned in the previous section. The
workbench allows us to write the de nition with table forms of diagrams, objects,
relationships, and properties. We can develop templates to generate codes in the
workbench. The next subsection shows how to de ne code templates.
Model Compiler The model compiler framework facilitates the development
of model compilers which obtain a DSL description and generate source code
according to a template and the DSL description. The model compiler runs on
the server side. The model compiler framework is developed with ejs[
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. ejs is a
template library written in JavaScript.
      </p>
      <p>Figure 6 shows an example of the code template to generate a name list of
objects of action de ned in Figure 2. We can access all of the diagrams, objects,
relations, and properties in the DSML model to describe an object reference code
of JavaScript in the code template. All of them are bound to " " as a top-level
variable. For example, if we want to access all the objects of "action," we can get
a reference to the states to describe " .states". In the code template, we can use
Javascript expressions with special markers. A line that begins with the " &lt;%"
marker indicates that the line is a control structure." &lt;%expression% &gt;" means
that it will be substitute a concrete string generated to evaluate JavaScript
expression.</p>
      <p>&lt;%for(var key in _.states) {%&gt;
&lt;%=_.states[key].action%&gt;
&lt;% } %&gt;</p>
      <p>Model Editor The editor is a tool to draw models de ned by the workbench
and to generate codes according to code templates and the model. Figure 5 shows
a screenshot of the clooca editor.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Evaluation</title>
      <p>As a test, we use clooca to de ne diagrams and code templates for some
applications.
3.1</p>
      <sec id="sec-3-1">
        <title>A software modeling course</title>
        <p>
          We used clooca in a software modeling course[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]. where approximately 80
students designed a class diagram and a state machine diagram for a line trace robot
and then ran the robot. The teacher de ned the DSML for the line trace robot on
clooca, and the students used the DSML. Teachers are always concerned about
modifying lab environments to employ special tools; however, clooca eliminates
this concern because it does not require installation, as mentioned above.
3.2
        </p>
      </sec>
      <sec id="sec-3-2">
        <title>For a project-based learning and in a classroom</title>
        <p>We also used clooca in a classroom setting to lecture about the concept of
modeldriven development and DSMLs. The teacher de ned a simple class diagram
and a state-machine diagram of the UML and developed code generators, which
generate JavaScript codes running on a web browser according to the input
model. We can execute the generated code on browsers. The number of students
in this classroom setting was approximately 20. In this test, we successfully used
clooca without any installation efforts.
4</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Conclusion</title>
      <p>
        Clooca is a SaaS type of development environment that allows users to build
DSMLs, and their code generators [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] . We can use clooca without any
installation efforts. In this paper, we proposed a novel method to de ne DSMLs that
is suitable for web based services including clooca. We described the clooca
architecture and its implementations that employ a method to de ne DSMLs. We
described some cases to prove the usefulness of clooca. These cases demonstrate
bene ts of SaaS type of DSML tools.
      </p>
      <p>Our future work is to evaluate quantitatively with effort according to the
deployment of clooca: for example, we should compare the time it takes to set
up and installation with the conventional tool.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>S.</given-names>
            <surname>Kelly</surname>
          </string-name>
          and
          <string-name>
            <given-names>J.-P.</given-names>
            <surname>Tolvanen.</surname>
          </string-name>
          Domain-Speci c Modeling: Enabling Full Code Generation. Wiley-IEEE Computer Society Press,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>S.</given-names>
            <surname>Cook</surname>
          </string-name>
          , G. Jones,
          <string-name>
            <given-names>S.</given-names>
            <surname>Kent</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A. C.</given-names>
            <surname>Wills</surname>
          </string-name>
          .
          <article-title>Domain Speci c Development with Visual Studio DSL Tools (Microsoft .Net Development)</article-title>
          .
          <source>Addison-Wesley Longman</source>
          ,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>Graphical</given-names>
            <surname>Modeling</surname>
          </string-name>
          <article-title>Project</article-title>
          . http://www.eclipse.org/modeling/gmp/ [
          <source>Online; accessed July 1</source>
          <year>2013</year>
          ].
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Introduction</surname>
            <given-names>JSON</given-names>
          </string-name>
          , http://www.json.
          <source>org/ [Online; accessed July 1</source>
          <year>2013</year>
          ].
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5. ejs Javascript Template, http://embeddedjs.com/ [
          <source>Online; accessed July 15</source>
          <year>2013</year>
          ].
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>6. clooca http://www.clooca.com</mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>K.</given-names>
            <surname>Masumoto</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Kayama</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Ogata</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Itoh</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Hashimoto</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M.</given-names>
            <surname>Otani</surname>
          </string-name>
          .
          <article-title>A Basic Study of Teaching Methods for Model-Based Design with Error Analyses of Beginners</article-title>
          .
          <source>ESS2012. pp101-109</source>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>