- freely available
Computers 2019, 8(4), 89; https://doi.org/10.3390/computers8040089
- What aspects of each MDA level should the system designer cover while modeling the software system?
- Which models should be chosen to model the system well at each MDA level?
- How can we generate the code architecture from the CIM level using successive transformations between the different MDA levels with respect to traceability?
2. Proposed Approach
- Describing system requirements using business vocabulary and business rules of SBVR in CIM level .
- Generating automatically the use case diagram from SBVR in the same level  using the MoDAr-WA plug-in.
- Generating the PIM level automatically, which is represented by the business class diagram and system sequence diagram from the CIM level using the QVT transformation rules implemented in the plug-in .
- Automatically generating the PSM level of the MVC web application modeled by detailed class diagram and detailed sequence diagram using the MoDAr-WA plug-in (presented in this paper).
- Automatically generating the application code through the Acceleo transformation rules implemented in the plug-in (presented in this paper).
2.1. PIM Level in Our Approach
- The structural aspect describes the link between elements representing the system. This aspect is covered by the business class diagram in our approach. Figure 2 represents the main fragments of the business class diagram.
- The behavioral aspect describes the flow of actions between system elements. In our approach, this aspect is covered by the system sequence diagram which is a type of sequence diagram where the system is targeted as a black-box in order to respect the platform independence criteria of the PIM level. Figure 3 represents the main fragments of system sequence diagram.
2.2. PSM in Our Approach
- Static Aspect: Describes static elements of the PSM level. In our approach this aspect is represented by the model classes in the detailed class diagram.
- Structural Aspect: Describes associations between class diagram elements. In our approach, this aspect is covered by associations in the detailed class diagram.
- Dynamic Aspect: Describes the communication between different elements of the system. Controller classes cover this aspect in our approach.
- Behavioral Aspect: Describes the flow of actions in the system. In our approach, this aspect is represented by the detailed sequence diagram, which is a detailed version of the system sequence diagram, where the system is replaced by all internal system objects and messages inside the system. In our PSM level, we model each layer of MVC architecture as lifeline elements in DSD. Figure 4 describes the main fragments of the detailed sequence diagram.
2.3. Transformations Rules
2.3.1. PIM to PSM Transformation Rules
- BCD&SSD2MVC_DCD: The business class diagram and system sequence diagram to MVC class diagram is a set of transformation rules that generate the detailed class diagram of the PSM level from BCD (Business Class Diagram) and SSD (System Sequence Diagram) of the PIM level.
- Class2Model: Each class in BCD in the PIM level (generated from Actor and DataObject of the CIM) is turned into a model class in MVC detailed class diagram in the PSM level.
- Class.name2Model.name: The name of the model is the same name as the class from which the model was generated, preceded by the stereotype <<Model>>.
- Class.Attribute2Model.Attribute: Attribute elements of the model are the same as the attributes of the class in the PIM level with same names and types (these attributes were generated from “Is_property_of” fact type in the CIM level).
- Class.Method2Model.Method: The class’ methods are transformed into the methods of the model. At this level, the model class contains only the methods’ signatures that call the methods described in the controller class.
- Association2Controller: The association between two classes in the PIM level will be transformed into a controller class in the PSM level (the associations in the PIM level were generated from the “Associative” fact type in the CIM level).
- Association.verb2Controller.name: The name of the controller class is generated from the verb of the association preceded by <Controller> stereotype.
- Association.AssociationEnd.name2Controller.Attribute.name: The name of attribute in the <<Controller>> class is generated from the name of the association end to which is related.
- Association.AssociationEnd.Class.name2Controller.Attribute.type: The type of the attribute is generated from the name of the class at the association end.
- Association.AssociationEnd.Class.Method2Controller.Method: The methods of the controller class are generated from the methods of the two classes of the association, provided that these methods relate to the two classes connected by the association that generates the controller.
- SSD2View: Each system sequence diagram (Generated for each use case element based on SBVR in the CIM level) is transformed into a view class in the PSM level.
- SSD.name2View.name: The name of the view class is the name of the SSD preceded by the <<View>> stereotype.
- AssociationEnd2Contoller-ModelAssociation: The association between the controller and the model is generated from the association end between the class transformed into a model and an association transformed into a controller.
- SSD.lifeline2Model-ViewAssociation: The association between the model and the view is generated from the membership between the SSD and the lifeline.
- Class.Method.name2Association.verb: The common method name between the model and the controller to which it is linked, is transformed to a verb of the association.
- Class(Model|Controller|View).name2AssociationEnd.name: The name of the association end is the name of the class (Model|Controller|View) at the end.
- AssociationEnd.upper2AssociationEnd.upper/AssociationEnd.lower2AssociationEnd.lower: The upper and the lower cardinality is the same in the corresponding side of the association.
- BCD&SSD2MVC_DSD: The business class diagram and system sequence diagram to detailed sequence diagram is a set of transformation rules that allow the ability to automatically generate the detailed sequence diagram of the PSM level from the BCD and SSD of the PIM level. The following rules are applied to each system sequence diagram and for its corresponding classes from the class diagram in the PIM level (Table 2).
- ActorLifeLine2ActorLifeLine: The Actor in the DSD in the PSM level is generated from the Actor in the SSD of the PIM level.
- SequenceDiagramSystem2ViewLifeLine: The sequence diagram system is turned into a life line view in the PSM level.
- Class2ModelLifeLine: Each class that was generated from a DataObject element is turned into a life line model in the DSD of PSM level.
- Opt2Opt: The option fragment is the same option fragment in the corresponding sequence diagram.
- Ref2Ref: Reference fragment is generated from the reference fragment in SSD.
- Alt2Alt: Alt fragment is generated from the alt fragment in SSD.
- Messages between the ActorLifeLine and the ViewLifeLine in SSD are generated from messages exchanged between the Actor and the system in SSD.
- Messages between the ViewLifeLine and ControllerLifeLine are the forward of messages between Actor and ViewLifeLine.
- Messages between ControllerLifeLine and ModelLifeLine are the forward of messages between ViewLifeLine and ControllerLifeLine.
- Operation2ControllerLifeLine: ControllerLifeLine is generated from a class operation.
2.3.2. PSM to Code Transformations
- Stereotype2Package: In our approach, we have three class stereotypes (Model, View, Controller) from which we generate three packages:
- The name of each package is the combination of the name of the project and the stereotype name.
- Each class is allocated to the package, and generated from the corresponding stereotype.
- Controller2ServletClass: Servlet classes are generated from classes with the controller stereotype. The Servlet class name is the name generated of the class + “extends httpServlet”.
- Model2ModelClass: A class with the “Model” stereotype is turned into a “JavaBean” class.
- View2webPage: A class with the “view” stereotype is turned into a “jsp” page.
- Attribute2Attribute: Each attribute in a class is turned into an attribute of the corresponding generated class.
- LifeLineController2Operation: A LifeLineController element of DSD is turned into an operation in the Servlet class.
- Alt2IfCondition: Each “Alt” fragment of DSD is transformed into an “If condition” code part.
- Conditions are generated from the Alt condition in DSD.
- Operations of each condition are generated from an action (Messages, Fragments) inside the “Alt” fragment.
- Break2Break: “Break” fragment is turned into a break in code.
- Ref2Operation: “Ref” fragment in DSD is turned into an operation in the Servlet class generated from the corresponding controller. If a “Ref” fragment is inside an “Alt” fragment, the operation is placed in the “If condition” generated from the corresponding “Alt” fragment.
- Opt2IfCondition: “Opt” fragment is turned, like the “Alt”, into an “If” condition in the code. Messages inside the “Opt” fragment are turned into operations of the corresponding “If” condition.
- Loop2ForLoop: The “For Loop” is generated from the “Loop” fragment in DSD. The “Min” and “Max” values of the loop are generated from “MinInt” and “MaxInt” values specified in DSD.
3. Implementation of Our Approach
3.1. Papyrus Modeling Tool
3.2. Query View Transformation Language
3.3. Acceleo Plug-In
3.4. MoDAr-WA Plug-In
4. Case Study
- Number of classes: For this criterion, we checked if MoDAr-WA generated the same classes as defined in the source code application, and that the percentage of this criteria is more than 100%, that is, we generate more classes than was implemented in . This result is due to the traceability ensured by our approach. Indeed, we have defined at the CIM level an “Admin” actor, for example, that was transformed as a model class in the code level, while in the existing code, developers did not implement a model class for this actor but only its views and controllers.
- Number of Attributes: We calculated the total number of attributes of all classes in this layer. For this criterion, the MoDAr-WA plug-in had allowed the generation of 100% of the defined attributes for all model classes. This value is calculated from the comparison of similar classes only in the generated code by MoDAr-WA and the implemented one.
- Number of Methods (with signature and body): For this criterion, we calculated the number of all methods and their signatures in model classes, including “setters” and “getters”. As described in Table 4, our approach generated 86.66% of methods of the model classes. Making the comparison between generated methods and manually developed ones, we note that in the existing code, developers have defined methods that detail other ones, while in our approach we generated only the methods defined at the first level CIM.
- Number of controllers: As in the model layer, we checked if the utilization of the MoDAr-WA plug-in allows the ability to generate controllers as defined in the coded application. The percentage of this criteria was more than 100% and this value could be explained by the fact that, in our approach, we generate for each feature a separated controller, while in the project code, developers used a macro controller where features were defined as methods of the controller.
- Number of Attributes: This defines the total number of attributes in controller classes. For this criterion, our approach has generated 100% of the attributes that are the instantiation of model classes connected by the controller.
- Number of Methods: Calculates the total number of methods in controller classes. As previously mentioned, in our approach we generate, for each feature, a controller, while in the existing code, features are methods in the macro controller, which explain the 56.25% as a value of this criterion.
5. Related Works
- Model categories aspects: We discuss if the proposed approaches cover all levels aspects defined, based on OMG specifications.
- Transformation rules: In this part we discuss the automation, completeness, and traceability of transformation rules defined in the different works (N = No, Y = Yes, and P = Partially).
- MoDAr-WA allows us to generate 86.56% of executable elements from structured system requirements (SBVR).
- MoDAr-WA respects the MDA paradigm. Indeed, it generates J2EE project from CIM, PIM, and PSM levels through successive transformations.
- RM2PT allows us to generate 93.65% of executable elements, which is higher than MoDAr-WA. However, this approach does not respect the MDA paradigm, it covers only PSM level which is manually designed. Thus, a higher time is required to use this approach (as all source elements should be designed by developers). Moreover, this tool does not allow us to generate the complete project, but only separated files containing a generated code.
- The other approaches in the previous table generates less than 50% of source code elements, and does not cover all the MDA levels.
6. Conclusions and Future Work
- An MDA approach that takes into account all levels and aspects of MDA and provides traceability. This approach introduces a set of meta-models to define the relevant information in each MDA level and set of transformations to generate the source code of MVC web applications from models in CIM.
- A tool support MoDAr-WA that allows the automatic generation of web application source code from requirements description in CIM using SBVR. The plug-in MoDAr-WA makes also possible the use of elementary transformation from one level to another separately. Thus, the user could enrich or modify the generated models in one level before generating models or code in the following level.
- Generating a more generic PSM models from PIM: In the current approach, we generate diagrams representing the PSM level that are specific for JavaEE MVC web application, so in our future work we aim to propose a solution where we define a generic meta-model of the PSM level that can support different technical platforms. Then, through an horizontal transformation in the same level a specific PSM for the desired technical platform can be automatically generated to finally generate the application source code.
- Combining model based testing (MBT) with MDA to deal with the testing phase, which is one of the important steps in software development life cycle. As the key of our approach is based on models and follows MDA principles, we have proposed in one of our previous works , an approach that allows the generation of different types of test cases from modeling the different MDA levels. In the future, we intend to automate and improve these transformations in order to automatically generate test cases from models.
- Integrating MDA in agile methods or even proposing a new one that deals with MDA. The automation of MDE approaches (MDA and MBT in our case) allows us to ensure the portability, interoperability, and traceability of developed systems. However, the evolution of the system requirement is still an issue to deal with and that constitute a promoting research axis. In order to deal with this issue, we aim to propose an agile approach where models are the key of development. We mention that we presented in our work —our reflection on the combination of MDA and some agile methodologies and incremental life cycles. We have also proposed an approach that combines MDA, MBT, and V life cycle in scrum sprints . More work and experiments must be done to perform these propositions in a fully automatic way.
Conflicts of Interest
|MoDAr-WA||Model Driven Architecture for Web Application|
|MDA||Model Driven Architecture|
|M2M||Model to Model|
|M2T||Model to Text|
|OMG||Object Management Group|
|UML||Unified Modeling Language|
|QVT||Query View Transformation|
|UCD||Use Case Diagram|
|SBVR||Semantic Business Vocabulary and Business Rules|
|BCD||Business Class Diagram|
|SSD||System Sequence Diagram|
|DCD||Detailed Class Diagram|
|DSD||Detailed Sequence Diagram|
|CIM||Computation Independent Model|
|PIM||Platform Independent Model|
|PSM||Platform Specific Model|
|SPA||Single Page Application|
|OOHDM||Object Oriented Hypermedia Design Method|
|HDM||Hypermedia Design Method|
- Miranda, M.A.; Ribeiro, M.G.; Marques-Neto, H.T.; Song, M.A.J. Domain-specific language for automatic generation of UML models. IET Softw. 2017, 12, 129–135. [Google Scholar] [CrossRef]
- Bézivin, J. On the unification power of models. Softw. Syst. Model. 2005, 4, 171–188. [Google Scholar] [CrossRef]
- Koch, N.; Kraus, A. The Expressive Power of UML-based Web Engineering. In Proceedings of the Second International Workshop on Web-oriented Software Technology (IWWOST02), Málaga, Spain, 10–14 June 2002. [Google Scholar]
- Ceri, S.; Fraternali, P.; Bongio, A. Web Modeling Language (WebML): A modeling language for designing Web sites. Comput. Netw. 2000, 33, 137–157. [Google Scholar] [CrossRef]
- AndroMDA. 2008. Available online: http://andromda.org/modeling.html (accessed on 3 December 2019).
- Essebaa, I.; Chantit, S. Tool Support to Automate Transformations between CIM and PIM Levels. In Proceedings of the 12th International Conference on Evaluation of Novel Approaches to Software Engineering—Volume 1: MDI4SE, INSTICC, Porto, Portugal, 28–29 April 2017; SciTePress: Setúbal, Portugal, 2017; pp. 367–378. [Google Scholar] [CrossRef]
- Essebaa, I.; Chantit, S. Tool Support to Automate Transformations from SBVR to UML Use Case Diagram. In Proceedings of the 13th International Conference on Evaluation of Novel Approaches to Software Engineering—Volume 1: MDI4SE, NSTICC, Madeira, Portugal, 23–24 March 2018; SciTePress: Setúbal, Portugal, 2018; pp. 525–532. [Google Scholar] [CrossRef]
- Papyrus. 2010. Available online: https://www.eclipse.org/papyrus/resources/PapyrusTutorial_OnSequenceDiagrams_v0.1_d2010100.pdf (accessed on 3 December 2019).
- MOF. OMG, Meta Object Facility (MOF) 2.0 Query/View/Transformation Specification. 2009. Available online: http://www.omg.org/spec/QVT/1.0/PDF (accessed on 3 December 2019).
- Acceleo. 2006. Available online: https://www.eclipse.org/acceleo/ (accessed on 3 December 2019).
- MusicStore Project. 2015. Available online: https://github.com/MichalGoly/MusicStore (accessed on 3 December 2019).
- Schwabe, D.; Rossi, G. The object-oriented hypermedia design model. Commun. ACM 1995, 38, 45–47. [Google Scholar] [CrossRef]
- Schmid, H.A. Model Driven Architecture with OOHDM. In Proceedings of the the 4th International Conference on Web Engineering, Munich, Germany, 28–30 July 2004; pp. 12–25. [Google Scholar]
- Schmid, H.A.; Donnerhak, O. OOHDMDA—An MDA approach for OOHDM. In Proceedings of the International Conference on Web Engineering, Sydney, NSW, Australia, 27–29 July 2005; Springer: Berlin/Heidelberg, Germany, 2005; pp. 569–574. [Google Scholar]
- WebRatio. 2011. Available online: http://www.webratio.com (accessed on 3 December 2019).
- Moreno, N.; Fraternalli, P.; Vallecillo, A. A UML 2.0 profile for WebML modeling. In Proceedings of the Workshop Sixth International Conference on Web Engineering, Palo Alto, CA, USA, 10–14 July 2006; ACM: New York, NY, USA, 2006; p. 4. [Google Scholar]
- Schauerhuber, A.; Wimmer, M.; Kapsammer, E. Bridging existing Web modeling languages to model-driven engineering: A metamodel for WebML. In Proceedings of the Workshop Sixth International Conference on Web Engineering, Palo Alto, CA, USA, 10–14 July 2006; ACM: New York, NY, USA, 2006; p. 5. [Google Scholar]
- Knapp, A.; Koch, N.; Zhang, G. Modeling the structure of web applications with argouwe. In Proceedings of the International Conference on Web Engineering, Munich, Germany, 26–30 July 2004; Springer: Berlin/Heidelberg, Germany, 2004; pp. 615–616. [Google Scholar]
- Abrahão, S.; De Marco, L.; Ferrucci, F.; Gomez, J.; Gravino, C.; Sarro, F. Definition and evaluation of a COSMIC measurement procedure for sizing Web applications in a model-driven development environment. Inf. Softw. Technol. 2018, 104, 144–161. [Google Scholar] [CrossRef]
- Gómez, J. Model-driven web development with visualwade. In Proceedings of the International Conference on Web Engineering, Munich, Germany, 26–30 July 2004; Springer: Berlin/Heidelberg, Germany, 2004; pp. 611–612. [Google Scholar]
- OptimalJ. 2007. Available online: http://www.compuware.com/products/optimalj (accessed on 3 December 2019).
- Deeba, F.; Kun, S.; Shaikh, M.; Dharejo, F.A.; Hayat, S.; Suwansrikham, P. Data transformation of UML diagram by using model-driven architecture. In Proceedings of the 2018 IEEE 3rd International Conference on Cloud Computing and Big Data Analysis (ICCCBDA), Chengdu, China, 20–22 April 2018; pp. 300–303. [Google Scholar]
- Esbai, R.; Erramdani, M.; Mbarki, S.; Arrassen, I.; Meziane, A.; Moussaoui, M. Transformation by modeling MOF 2.0 QVT: from UML to MVC2 web model. INFOCOMP 2011, 10, 1–11. [Google Scholar]
- Brambilla, M.; Fraternali, P. Implementing the semantics of BPMN through model-driven web application generation. In Proceedings of the International Workshop on Business Process Modeling Notation, Lucerne, Switzerland, 21–22 November 2011; Springer: Berlin/Heidelberg, Germany, 2011; pp. 124–129. [Google Scholar]
- Hernandez-Mendez, A.; Scholz, N.; Matthes, F. A Model-driven Approach for Generating RESTful Web Services in Single-Page Applications. In Proceedings of the 6th International Conference on Model-Driven Engineering and Software Development (MODELSWARD 2018), Funchal, Madeira, Portugal, 22–24 January 2018; pp. 480–487. [Google Scholar]
- Dogdu, E.; Hakimov, S.; Yumusak, S. A data-model-driven web application development framework. In Proceedings of the 2014 ACM Southeast Regional Conference, Kennesaw, Georgia, 28–29 March 2014; ACM: New York, NY, USA, 2014; p. 47. [Google Scholar]
- Huang, Y.C.; Chu, C.P.; Lin, Z.A.; Matuschek, M. Transformation from Web PSM to Code. In Proceedings of the International Conference on Distributed Multimedia Systems (DMS), Lisbon, Portugal, 8–9 July 2009. [Google Scholar]
- Bousetta, B.; Beggar, O.E.; Gadi, T. A Model Transformation Approach for Code Generation from State Machine Diagram. IADIS Int. J. Comput. Sci. Inf. Syst. 2014, 9, 1–15. [Google Scholar]
- Albert, M.; Cabot, J.; Gómez, C.; Pelechano, V. Generating Operation Specifications from UML Class Diagrams: A Model Transformation Approach. Data Knowl. Eng. 2011, 70, 365–389. [Google Scholar] [CrossRef]
- Bozzon, A.; Comai, S.; Fraternali, P.; Carughi, G.T. Conceptual Modeling and Code Generation for Rich Internet Applications. In Proceedings of the 6th International Conference on Web Engineering (ICWE ’06), Palo Alto, CA, USA, 11–14 July 2006; ACM: New York, NY, USA, 2006; pp. 353–360. [Google Scholar] [CrossRef]
- Jamda. 2013. Available online: http://jamda.sourceforge.net/ (accessed on 3 December 2019).
- Conallen, J. Building Web Applications with UML; Addison-Wesley: Boston, MA, USA, 2002. [Google Scholar]
- Yang, Y.; Li, X.; Liu, Z.; Ke, W. RM2PT: A Tool for Automated Prototype Generation from Requirements Model. In Proceedings of the 41st International Conference on Software Engineering: Companion Proceedings (ICSE ’19), Montreal, QC, Canada, 25–31 May 2019; IEEE Press: Piscataway, NJ, USA, 2019; pp. 59–62. [Google Scholar] [CrossRef]
- Telosys. 2018. Available online: https://modeling-languages.com/telosys-tools-the-concept-of-lightweight-model-for-code-generation/ (accessed on 3 December 2019).
- Umple. 2018. Available online: https://cruise.eecs.uottawa.ca/umple/ (accessed on 3 December 2019).
- De Lara, J.; Guerra, E.; Cuadrado, J.S. Model-driven engineering with domain-specific meta-modelling languages. Softw. Syst. Model. 2015, 14, 429–459. [Google Scholar] [CrossRef]
- Essebaa, I.; Chantit, S. A Combination of V Development Life Cycle and Model-based Testing to Deal with Software System Evolution Issues. In Proceedings of the 6th International Conference on Model-Driven Engineering and Software Development—Volume 1: MODELSWARD, INSTICC, Funchal, Madeira, Portugal, 22–24 January 2018; SciTePress: Setúbal, Portugal, 2018; pp. 528–535. [Google Scholar] [CrossRef]
- Essebaa, I.; Chantit, S. Model Driven Architecture and Agile Methodologies: Reflexion and discussion of their combination. In Proceedings of the 2018 Federated Conference on Computer Science and Information Systems (FedCSIS 2018), Poznan, Poland, 9–12 September 2018; pp. 939–948. [Google Scholar] [CrossRef]
- Essebaa, I.; Chantit, S. Scrum and V Lifecycle Combined with Model-Based Testing and Model Driven Architecture to Deal with Evolutionary System Issues. In Model and Data Engineering, Proceedings of the 8th International Conference on Model and Data Engineering; Marrakesh, Morocco, 24–26 October 2018, Springer: Cham, Switzerland, 2018; pp. 77–91. [Google Scholar] [CrossRef]
|Comparison Elements||Generated Code with MoDAr-WA||Total Code||Percentage (%)|
|Model||Number of Classes||11||10||>100|
|Number of Attributes||38||38||100|
|Number of Methods(signature)||91||105||86.66|
|View||Number of views||15||22||68.18|
|Controller||Number of Controllers||15||5||>100|
|Number of Attributes||18||18||100|
|Number of Methods||18||32||56.25|
|Hernandez and al.||Brambilla and al.||OOHDMDA||WebRatio||WebML1||WebML2||UWE (ArgoUWE)||OOH||OptimalJ||Deeba and al.||Esbai and al.||Dogdu and al.||Huang and al.||Boussetta and al.||Albert and al.||Bozzon and al.||Jamda||Conallen|
|UML Models (XML format)||UML Class Diagram,|
|UML Class Diagram||UML UCD,|
Contracts of Systems Operations,
Conceptual Class Diagram
|J2EE Sample||Java, C++,|
|Java code for |
|MVC Java code||J2EE Executable |
|% Generated elements||<50%||<50%||<50%||<50%||93.65%||89.56%|
© 2019 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).