MDA Approach for Laravel Framework Code Generation from UML Diagrams

MDA Approach for Laravel Framework Code Generation from UML Diagrams

MDA Approach for Laravel Framework Code Generation from UML Diagrams Mantas Ražinskasa, Lina Čeponienėb aFaculty of Informatics of Kaunas University of Technology, Kaunas, Lithuania bInformation Systems Department of Kaunas University of Technology, Kaunas, Lithuania Abstract Laravel is a popular PHP framework used in web development. To facilitate and simplify the work of software developers us- ing this framework, this paper proposes an MDA based methodology for developing Laravel based web information systems. This methodology implementation would allow software developers to generate Laravel code from UML diagrams through MDA transformations from PIM to PSM (with Laravel PSM profile applied) and from PSM to code. Developers then couldfill the gaps in the generated PHP code for Laravel framework to develop a complete web information system. Keywords Laravel, MDA, MVC, UML model, code generation 1. Introduction code generation save time in the IS development pro- cess, reduce the risk of potential errors, and simplify The modern need for development of high quality in- modifications [7]. Currently, code generation is avail- formation systems (IS) at minimal cost is rapidly chang- able in popular UML CASE tools, which usually have ing their development methodologies, with stronger the code generation functionality from structural UML emphasis on the facilitation of IS development and main- diagrams to object oriented programming languages tenance [1,2,3]. A possible solution for developing (C#, Java, etc.). systems more efficiently is to use Unified Modelling The principles of Model Driven Architecture can be Language (UML) [4] – a modeling standard developed applied in the development of various information sys- by the OMG Computer Industry Standards Consor- tems, including web-based ones. In the context of web tium, and Model Driven Architecture (MDA) [5,6] – an development, PHP can be considered the most widely approach for software development by means of mod- used programming language [8]. Various PHP frame- els and transformations between them. MDA enables works are widely used for facilitating the implementa- model driven systems to be built using model trans- tion process. Frameworks have a structured architec- formations from one model type to another. There are ture, simplify the database connection, are easily ex- different types of models in MDA, for example Plat- tended with additional libraries, and are usually based form Independent Model (PIM) which defines imple- on the Model View Controller (MVC) architecture prin- mentation independent abstract system functions, and ciples [8]. MVC gives an effective and proven way of Platform-Specific Model (PSM), which defines theim- developing modular, structured systems. In addition to plementation of system functions in a selected plat- benefits of using a framework, introducing the MDA form. UML is specified by its metamodel which can principles and employing PHP code generation from also be extended by using the profile mechanism. In UML diagrams for a certain framework could make this situation, UML profile extends a referenced meta- web IS development process even more efficient and model to adapt or customize it with constructs that reduce time-to-market. are specific to a particular platform [4]. In MDA ap- Laravel [9] is a popular PHP framework suitable for proach, after defining the PSM model, the next step rapid development of small to large scale systems, even is to generate the source code for the selected imple- with relatively little experience [8, 10, 11]. This frame- mentation platform that corresponds to the elements work is based on the MVC architecture principles and defined in the PSM [5]. Model transformations and assists in building web systems faster and easier, by IVUS 2020: Information Society and University Studies, 23 April 2020, providing basic model structure, API access, libraries, KTU Santaka Valley, Kaunas, Lithuania and plugins. It also helps developers become more " [email protected] (M. Ražinskas); productive by reducing duplicate code in an ongoing [email protected] (L. Čeponiene)̇ project [12]. © 2020 Copyright for this paper by its authors. Use permitted under Creative Based on framework comparison results [11], it is Commons License Attribution 4.0 International (CC BY 4.0). CEUR http://ceur-ws.org Workshop ISSN 1613-!!" easier to get started with Laravel than with other pop- Proceedings CEUR Workshop Proceedings (CEUR-WS.org) ular PHP framework, Symfony, and Symfony is more pleted system modelling, the code generation proce- suitable for developing complex systems. In this paper, dure was followed by the model-to-text transforma- an MDA based methodology is presented which inves- tion (M2T). To generate CodeIgniter code, the authors tigates the application of model transformation princi- used Acceleo software and CodeIgniter metamodel tem- ples in the context of PHP programming language and plate. its Laravel framework. The transformations from PIM The principles of MDA were also applied in research to Laravel based PSM and from Laravel PSM to Laravel by Srai, Guerouate, Berbiche, Lahsini [15] to create a PHP code are analyzed. The proposed concept could Spring MVC system using a UML class diagram. First, help software developers build web information sys- a metamodel was created that matched the Spring MVC tems more efficiently by applying UML diagrams and template. The target metamodel consisted of two es- MDA principles. sential parts: the first part referred to the views pack- The rest of the paper is organized as follows. In re- age, this package consisted of many JSP pages. The lated work section related studies in the area of MDA second part consisted of a controller package, and this and code generation are discussed. In the third section, package encompassed a number of controllers and each the general process of the proposed methodology for controller having one or more actions. Laravel code generation is presented, along with func- Authors defined transformation rules for model to tional requirements for the methodology implementa- model and model to code transformations. These rules tion and implementation strategy representation. The enabled creation of an XML file containing all the ac- fourth section discusses guidelines for implementation tions, forms, and JSP pages that can be used to gen- of proposed concept and presents a short examples erate code. Authors developed a transformation al- of developed models and generated code. Finally, in gorithm using the ATL transformation language [17] the conclusions section, conclusions are presented and (this language is part of the Eclipse M2M). Next, the further research perspectives are discussed. model to text transformation was developed to gener- ate Spring MVC code. For the model to text transfor- mation, a Spring MVC template was defined. 2. Related Work A tool that support the Model Driven Architecture (MoDAr-WA) was introduced by Essebaa, et al. [16], In recent years, there has been a numerous research on which implements a methodology automating trans- MDA and code generation [13, 14, 15, 16]. In this pa- formations from the highest MDA level (CIM) to the per, the studies associated with framework based code lowest (code). This research is a continuation of the generation [14, 15, 16] were selected for more detailed former work in automating transformations from CIM investigation. to PIM. The MoDAr-WA authors created sets of meta- In research paper by Arrhioui, Mbarki, Betari, Roubi, models for UML class and sequence diagrams, QVT Erramdani [14], the authors explored a model driven and Acceleo transformations, as well as Eclipse plu- architecture approach for PHP CodeIgniter framework. gin for MoDAr-WA. In particular, QVT rules for trans- The authors proposed a methodology that enables mod- formations between models (from CIM to PIM, from eling web systems based on the PHP CodeIgniter frame- PIM to PSM) were used. At the PIM level, the authors work and used an MDA approach to develop their me- defined key structural and behavioral aspects in UML thodology. This methodology encompasses transfor- class and sequence diagrams. Java source code from mations from PIM to PSM using UML class diagram as PSM was generated with the help of Acceleo tool. a source model to generate an XML file with the essen- All of the analyzed researches aim to apply MDA tial components of the CodeIgniter framework. The principles to improve the process of system develop- use of model transformations has provided benefits in ment. They provide a detailed definition of their pro- improving the quality of the system development pro- posed theoretical concept and its implementation, by cess while reducing costs and time. defining profiles, transformation rules and algorithms, This approach demonstrated efficiency by enabling as well as experimental implementation examples. The the creation of a complete CodeIgniter MVC architec- analyzed methodologies are intended for various frame- ture framework with defined metamodel and gener- works and architectures (PHP CodeIgniter, Spring MVC ated program code based on this metamodel. and Java MVC). The methodology proposed in our pa- The CodeIgniter framework metamodel developed per also applies MDA principles and analyses model by the authors is divided into packages of models, views, transformations and code generation, but in the con- and controllers. Each package has specific metaclasses text of Laravel framework, which is not

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    8 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us