0% found this document useful (0 votes)
969 views10 pages

A Baseline Domain Specific Language Proposal For Model-Driven Web Engineering Code Generation

The document proposes a baseline domain specific language (DSL) for model-driven web engineering code generation. It presents a metamodel with six main classes to generate HTML5 and PHP code: (1) Website, which represents the overall website, (2) Page, which generates code for individual web pages, (3) Component, which defines reusable UI elements, (4) Controller, which handles application logic and data access, (5) Model, which represents application data, and (6) Database, which connects to the database. The proposed DSL aims to support code generation for web applications using a basic language mix of HTML5 and PHP.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
969 views10 pages

A Baseline Domain Specific Language Proposal For Model-Driven Web Engineering Code Generation

The document proposes a baseline domain specific language (DSL) for model-driven web engineering code generation. It presents a metamodel with six main classes to generate HTML5 and PHP code: (1) Website, which represents the overall website, (2) Page, which generates code for individual web pages, (3) Component, which defines reusable UI elements, (4) Controller, which handles application logic and data access, (5) Model, which represents application data, and (6) Database, which connects to the database. The proposed DSL aims to support code generation for web applications using a basic language mix of HTML5 and PHP.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

A Baseline Domain Specific Language Proposal

for Model-Driven Web Engineering Code


Generation

Zuriel Morales1(B) , Cristina Magańa1 , José Alfonso Aguilar1 ,


Anı́bal Zaldı́var-Colado1 , Carolina Tripp-Barba1 , Sanjay Misra2 ,
Omar Garcia1 , and Eduardo Zurita1
1
Señales y Sistemas (SESIS) Facultad de Informática Mazatlán,
Universidad Autónoma de Sinaloa, Mazatlán, Mexico
{zmorales,cmagana,ja.aguilar,azaldivar,ctripp,ogarcia,ezurita}@uas.edu.mx
2
Department of Computer and Information Sciences,
Covenant University, Ota, Nigeria
[email protected]
http://sesis.maz.uasnet.mx

Abstract. It is well-known that Model-Driven Web Engineering


requires the development of code-generation tools in order to be adopted
outside research field as a complete solution in Web application devel-
opment industry. Regrettably, a fully-guided methodology supported by
a complete code-generation tool that considers a complete development
process based on MDA (Model-Driven Architecture) is missing. The idea
behind MDA is that requirements are considered (functional and non-
functional requirements) from the Computational Independent Model
(CIM), to the Platform Specific Model (PSM) passing for the Plat-
form Independent Model (PIM) to generate the source code for the Web
application. In our work is presented a baseline DSL (Domain Specific
Language) for Web application code-generation considering the basic lan-
guage used in a small software factory in Mexico. This is an ongoing work
which is part of a institutional project in order to build a suite of tools
for code-generation for Web application development.

Keywords: MDWE · Metamodel · DSL’s

1 Introduction
A model is an abstract representation of a system and a meta-model is an
abstract description of a model. The abstraction helps to neglect the less impor-
tant aspects of a system, while concentrating on favorable parts that are desired
to a specific study. Models are used to represent system functionality, Model-
Driven Web Engineering (MDWE) has become a success for Web application
development because with the use of models it is possible to represent (mod-
eling) the user needs (goals) without neglecting the organizational objectives,

c Springer International Publishing Switzerland 2016
O. Gervasi et al. (Eds.): ICCSA 2016, Part V, LNCS 9790, pp. 50–59, 2016.
DOI: 10.1007/978-3-319-42092-9 5
A Baseline Domain Specific Language Proposal 51

the software architecture and the business process and from this representa-
tion generate the Web application source code. In the last 20 years, several
MDWE methods [1] have been emerged for the development of Web applica-
tions using models to do it, but only some of them strictly complied with the
proposal of the Object Management Group (OMG) for Model-Driven Devel-
opment named Model-Driven Architecture (MDA) [2]. The basic idea of the
use of MDA starts from the Computational Independent Model (CIM), in this
first level, the application requirements must be elicited and defined, such that
we can generate through model-to-model transformations (M2M) the Platform
Independent Model (PIM) to finish in the Platform Specific Model (PSM) with
the source code due to model-to-text (M2T) transformation rules. Regrettably,
most of the MDWE methods does not provide a complete support tool and
only implements MDA from PIM to PSM leaving aside the requirements phase
(CIM level) despite this is a critical phase on which the success of the devel-
opment depends directly [3]. This fact can be seen in their support tools i.e.,
code generation tools and modeling tools. Although most of them define their
own notation for building models such as the navigation, the presentation or the
personalization model, we argue that in many cases it is just another notation
for the same concepts, i.e. they should be based on a common metamodel for
the Web application domain. In addition, tool-supported design and generation
is becoming essential in the development process of Web applications due to the
increasing size and complexity of such applications, and CASE-tools should be
built on a precisely specified metamodel of the modeling constructs used in the
design activities, providing more flexibility if modeling requirements change.
Bearing these considerations in mind, this paper presents a first step towards
such a baseline DSL (Domain Specific Language), also named metamodel.
A metamodel is a model of a model, and metamodeling is the process of gen-
erating such metamodels. Metamodeling or meta-modeling is the analysis, con-
struction and development of the frames, rules, constraints, models and theories
applicable and useful for modeling a predefined class of problems. As its name
implies, this concept applies the notions of meta- and modeling in software engi-
neering and systems engineering. Metamodels are of many types and have diverse
applications. In this context, we define a metamodel for code generation based
on HTML5 and PHP languages, the state of the implementation of this two lan-
guages mixed in a DSL is not present in the most well-known MDWE methods
according to [1], i.e., NDT [4], UWE [5] and WebML [6]. Moreover, the tools
used or developed for support code generation on each method is analyzed as a
previous work in our proposal. It is important to mention that, this is a complex
process to decide which techniques will be used in a project, determining, learn-
ing, acquiring, discovering the appropriate techniques, so this may negatively
influence the development process which results in system failures. Importantly,
we do not pretend to establish a full code-generation tool since Web application
development is on continuos change.
The rest of the paper is organized as follows: Sect. 2 presents some related
work regarding to DSL’s and metamodels in Model-Driven Web engineering.
52 Z. Morales et al.

Section 3 describes our baseline DSL for code-generation proposal. Finally, the
conclusion and future work is presented in Sect. 4.

2 Background

The advantages of Model-Driven Development (MDD) are well-known, specifi-


cally in Model-Driven Web Engineering [7], cost and effort reduced, achieving
profits in the project budget, among others. Thus, it is obvious that Web engi-
neering methods are now focus on adapting its approaches in to MDD paradigm,
but this transition, until now, has not been easy. This is specially true with regard
to tool support for code-generation, in particular for the user interface compo-
nents by code-generation, controls for the Rich Internet Applications are more
complex to build that common controls used in Web 1.0 development. One solu-
tion proposed to facilitate this work f are the so called metamodels, also named
Domain Spacific Languages (DSL’s) in the context of MDD. Next, is described
the background regarding the development of DSL’s for code generation and
user interface modelling.
In [8], the authors proposes a meta-model for abstract web applications that
can be mapped to multiple platforms. We extend a UML-based model to sup-
port specific features of the Web and Web 2.0 as well as to establish a bridge to
functional and usability requirements through use cases and user interface (UI)
prototypes. The meta-model also helps avoid a common MDD-related problem
caused by name-based dependencies. Finally, mappings to a number of specific
web platforms are presented in order to validate the appropriateness of the meta-
model as an abstract web model. This is focused in requirements-usability leav-
ing aside code generation. In [9], the authors presents a metamodel for require-
ments specification, this metamodel is defined in order to be created within NDT
methodology. The authors are no using the DSL definition for a User Interface
controls in order to be mapped to code. On the other hand, in [10], the work
presented by the authors is based on the usability patters applied in Model-
Driven Web Engineering, they focuses on the properties for being configured for
usability support.
There have been many attempts for adapting Rich Internet Applications con-
trols in Model-Driven Web Engineering for user interface development, but most
of the approaches are not supported by a methodology covering Model-Driven
Architecture and its three levels (CIM, PIM and PSM) to code-generation, the
support tool they offers generates JAVA Web applications such Webratio [11],
others look for its integration with another proposals such as [12] and NDT [13],
that’s the reason why we believe that our first attempt to create a easy to use
tool for code generation needs to be carried on based on a basic DSL for easy to
use and to learn for software developers not familiarized with code-generation
and modeling tools. According to [14], there is a big gap in the learning curve of
current software developers regarding to modeling tools for software modeling.
A Baseline Domain Specific Language Proposal 53

3 The Baseline DSL for Code Generation


This section describes the development of a metamodel for code generation in the
context of Model-Driven Web Engineering. The classes defined for each purpouse
are described in detail (see Fig. 1).
The Components. The metamodel has six main meta-classes, these are:

1. Website. This is the main class, this metamodel element contains all the web
site. It has one attribute named -name- for the web site name.
2. Page. The -Page- class is one of the most important ones because it generates
the HTML 5 code for a web page. Its attributes are: -title-, for the page title
and -accessibility level- for accesibility according to WCAG 2.0 (as a future
work this function will be enabled).
3. DisplayTable. This class is defined for in order to extract data from the data-
base. The attributes are: -title-, for the table title, -table- for the data binding
and -edit- and -delete- by attributes.
4. Form. The -Form- class is used to create a HTML form. The attributess
defined are: the form -name-, the name of the button, the send -method-
(POST or GET) and the table -name- on which the data from the form will
be stored or obtained.
5. Database. This class is defined in order to specify the parameters for database
connection such as the server name, user and password and the database
name. This class allows to select among different connectors.
6. Input. The -Input- class is the main class used to select among different
HTML 5 controls. It defines five attributtes used in HTML 5 controls, these
are: -id- for the control identifier, -name-, for the control name, -label, for the
control label, -attribute- for the control attribute such as -String- and -field
type- used to define the data type for the database binding.

Also, seven meta-classes are defined in order to specify HTML 5 controls and
attributes for HTML tables, these are: -Text-, Password-, -Radio-, -Combobox-,
-Checkbox-, -Option- and -Attributte-. These are basic HTML 5 controls, thats
the reason why the explanation of each one is out of the scope of this work,
see the reference about HTML 5 on World Wide Web Consortium: https://dev.
w3.org/html5/html-author/ for further information. The technology used for the
definition of our baseline metamodel is the Eclipse Modeling Project (https://
eclipse.org/modeling/emf/), by means of the implementation of the MOF archi-
tecture as a ECORE in Eclipse, we defined an ecore file for the meta-classes
definition.
Finally, it is important to mention that this section describes our baseline
metamodel for code generation based on HTML 5 and PHP languages, in this
sense, the main idea behind this work is to produce a complete model-driven
tool for semi-automatic web application generation for a local software factory
under open source initiative.
54 Z. Morales et al.

Fig. 1. A baseline DSL for a code-generation tool


A Baseline Domain Specific Language Proposal 55

Application Example. This subsection describes how the baseline metamodel


proposed works. Eclipse Modeling Framework (EMF) describes data models and
enables easy code generation from different types of data model artifacts, such as
XML Schema, the Rational Rose model, the Ecore model, or Java annotations.
In the process of code generation, the EMF generator creates model code, which
includes type-safe interfaces and implementation classes for the data model.
However, in certain situations, these type-safe interfaces and implementation
classes are not required by the application. Instead, data objects are required
that could be shared among or processed further by application components.
In such situations, Dynamic EMF comes in handy because it allows application
developers to manufacture an in-memory core model at run time programmati-
cally, make instances of it dynamically, and access the model instance elements
using the EMF reflective API.
Eclipse Modeling Framework provides a metamodel tester named Dynamic
Instance, this is used to create a model which is conforms to the metamodel. This
is the most simple way to create an instance of the metamodel. We need only
right click on the root class/model object of our metamodel (in our example,
it is the Website class), actually all the classes are only available, for creation,
through this root class (the containment property). See Fig. 2.

Fig. 2. Create dynamic instance from an ecore file, the main class named Website, this
is our model.

The next step consist in adding the elements corresponding to the HTML
components, the Dynamic Instance allows to create a model viewed as tree
editor, this model we created represents the final model, see Fig. 3. When we
finish the model, we will get a XMI file which we can convert into source code
by means of the Acceleo code generation templates (Fig. 4).
56 Z. Morales et al.

Fig. 3. The HTML elements we can add to the main class (root class) Website.

Fig. 4. The final model created from our metamodel.


A Baseline Domain Specific Language Proposal 57

In Fig. 5 we can see an extract of the Acceleo template for code generation
of the model created from our baseline metamodel for Model-Driven Web Engi-
neering code generation.

Fig. 5. The Acceleo template defined for the code generation.

The final source code generated from our baseline metamodel is presented
in Fig. 6, the source code is in PHP language, the operation is for delete an
elemenent from the database.

Fig. 6. The PHP code for the delete operation.


58 Z. Morales et al.

4 Conclusions and Future Work


A conclusion that comes out from our DSL is that the use of common models
and languages for component representation for code-generation tools is recom-
mended due to this fact will help to the use of the same terminology for user
interface modelling, because, a topic we found is the different terminology used
by current Model-Driven Web Engineering methods to name their types of com-
ponents for user interface modeling and code-generation. Therefore, if standard
concepts are promoted in Web modelling we can establish a standard form for
modeling user interface components and controls. In this respect, although stud-
ies have been conducted regarding the benefits of MDD in a development process
[7], few refer to the Web engineering domain, among which are the works pre-
sented in [10,16], thats the reason why it is necessary to conduct more studies
with regard to MDD in WE through empirical studies in order to validate and
support the potential application of these methods.
The use of current Web interface techniques for modelling the behavior of the
Web application is not common among the current methods for Model-Driven
Web Engineering. This leads to possible research lines in which mechanisms to
represent the behavior are studied to find a form to standarize its representation,
for instance with the new language IFML (Interaction Flow Modeling Language).
Furthermore, the notation for building such models should be intuitive and easy
to use, and it should have a serialization mechanism that allows integrating the
models with other methods.

Acknowledgments. This work has been partially supported by: Universidad


Autónoma de Sinaloa (México) by means of PROFAPI2014/002 Project. Thanks to
Señales y Sistemas research group for its collaboration. Thanks to the two main authors
of this paper for being a exceptional students, you have your thesis!.

References
1. Aguilar, J.A., Garrigós, I., Mazón, J.N., Trujillo, J.: Web engineering approaches
for requirement analysis- a systematic literature review. In: Web Information Sys-
tems and Technologies (WEBIST), Valencia, Spain, vol. 2, pp. 187–190. SciTePress
Digital Library (2010)
2. Brown, A.: Model driven architecture: principles and practice. Soft. Syst. Model.
3(4), 314–327 (2004)
3. Nuseibeh, B., Easterbrook, S.: Requirements engineering: a roadmap. In: Proceed-
ings of the Conference on the Future of Software Engineering, ICSE 2000, pp.
35–46. ACM, New York (2000)
4. Garcı́a-Garcı́a, J.A., Escalona, M.J., Ravel, E., Rossi, G., Urbieta, M.: NDT-merge:
a future tool for conciliating software requirements in MDE environments. In:
Proceedings of the 14th International Conference on Information Integration and
Web-Based Applications and Services, IIWAS 2012, pp. 177–186. ACM, New York
(2012)
A Baseline Domain Specific Language Proposal 59

5. Koch, N., Kraus, A., Hennicker, R.: The authoring process of the UML-based web
engineering approach. In: First International Workshop on Web-Oriented Software
Technology (2001)
6. Brambilla, M., Fraternali, P.: Large-scale model-driven engineering of web user
interaction: the WebML and WebRatio experience. Sci. Comput. Program. 89,
71–87 (2014)
7. Martı́Nez, Y., Cachero, C., Meliá, S.: MDD vs. traditional software development:
a practitioner’s subjective perspective. Inf. Softw. Technol. 55(2), 189–200 (2013)
8. Fatolahi, A., Some, S.S., Lethbridge, T.C.: A meta-model for model-driven
web development. Int. J. Soft. Inform. 6, 125–162 (2012)
9. Escalona, M.J., Koch, N.: Metamodeling the requirements of web systems. In:
Filipe, J., Cordeiro, J., Pedrosa, V. (eds.) Web Information Systems and Tech-
nologies. LNCS, vol. 1, pp. 267–280. Springer, Heidelberg (2007)
10. Insfran, E., Fernandez, A.: A systematic review of usability evaluation in web
development. In: Hartmann, S., Zhou, X., Kirchberg, M. (eds.) WISE 2008. LNCS,
vol. 5176, pp. 81–91. Springer, Heidelberg (2008)
11. Brambilla, M., Butti, S., Fraternali, P.: WebRatio BPM: a tool for designing and
deploying business processes on the web. In: Benatallah, B., Casati, F., Kappel, G.,
Rossi, G. (eds.) ICWE 2010. LNCS, vol. 6189, pp. 415–429. Springer, Heidelberg
(2010)
12. Linaje, M., Preciado, J.C., Morales-Chaparro, R., Rodrı́guez-Echeverrı́a, R.,
Sánchez-Figueroa, F.: Automatic generation of RIAs using RUX-tool and Webra-
tio. In: Gaedke, M., Grossniklaus, M., Dı́az, O. (eds.) ICWE 2009. LNCS,
vol. 5648, pp. 501–504. Springer, Heidelberg (2009)
13. Robles Luna, E., Escalona, M.J., Rossi, G.: Modelling the requirements of rich
internet applications in WebRe. In: Cordeiro, J., Virvou, M., Shishkov, B. (eds.)
ICSOFT 2010. CCIS, vol. 170, pp. 27–41. Springer, Heidelberg (2013)
14. Ceri, S., Brambilla, M., Fraternali, P.: The history of WebML lessons learned
from 10 years of model-driven development of web applications. In: Borgida, A.T.,
Chaudhri, V.K., Giorgini, P., Yu, E.S. (eds.) Conceptual Modeling: Foundations
and Applications. LNCS, vol. 5600, pp. 273–292. Springer, Heidelberg (2009)
15. Mishra, D., Mishra, A., Yazici, A.: Successful requirement elicitation by combin-
ing requirement engineering techniques. In: First International Conference on the
Applications of Digital Information and Web Technologies, ICADIWT 2008, pp.
258–263, August 2008
16. Valderas, P., Pelechano, V.: A survey of requirements specification in model-driven
development of web applications. ACM Trans. Web 5(2), 1–51 (2011)

You might also like