A Baseline Domain Specific Language Proposal For Model-Driven Web Engineering Code Generation
A Baseline Domain Specific Language Proposal For Model-Driven Web Engineering Code Generation
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
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. 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.
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.
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.
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)