Research and Implementation of Java Code Automatic Generator Based on UML
DOI:
https://doi.org/10.54097/dy6rcy68Keywords:
UML, Code generation, Java, meta model.Abstract
As a model-based tool, automatic code generation technology has been known and used by more and more developers due to its efficiency and convenience. This article combines UML and automatic code generation technology, proposes the conversion rules between UML model diagrams and Java code, and uses object-oriented and modular design ideas to divide the Java code automatic generator into input layer, data verification layer, and code. Generation layer, each layer uses the form of a unified interface for data exchange. Designed and implemented a Java code automatic generator based on UML model diagram. The main contents of this paper are as follows:(1)Study the mapping rules for converting UML class diagrams and sequence diagrams into Java code, extract the elements and relationships of various model diagrams, build a metamodel of UML model diagrams, and study the mapping between metamodels and Java statement-level code Relationship, and put forward sentence-level code conversion rules.(2)Using DOM, Xpath and trufun-plato plugins to parse the metadata in UML model diagrams. Through the previous study of UML class diagrams, sequence diagrams and state diagrams to the mapping rules of Java code, the coding realized automatic generation of Java code based on UML And verified the proposed Java code mapping rules.Through tests and practical use proofs, the UML model-based automatic Java code generator can convert UML model diagrams into parts of Java code, verifying the correctness and feasibility of the rules studied.
References
Quan Long, Zhiming Liu, Xiaoshan Li and He Jifeng, "Consistent code generation from UML models," 2005 Australian Software Engineering Conference, Brisbane, Queensland, Australia, 2005, p. 23-30.
F. Ciccozzi, A. Cicchetti and M. Sjödin, "Towards Translational Execution of Action Language for Foundational UML," 2013 39th Euromicro Conference on Software Engineering and Advanced Applications, Santander, 2013, p. 153-160.
S. E. V. and P. Samuel, "Automatic Code Generation From UML State Chart Diagrams," in IEEE Access, vol. 7, p. 8591-8608, 2019.
M. Thongmak and P. Muenchaisri, "Design of rules for transforming UML sequence diagrams into Java code," Ninth Asia-Pacific Software Engineering Conference, 2002., Gold Coast, Queensland, Australia, 2002, p. 485-494.
D. Torre, Y. Labiche, M. Genero, M. T. Baldassarre and M. Elaasar, "UML Diagram Synthesis Techniques: A Systematic Mapping Study," 2018 IEEE/ACM 10th International Workshop on Modelling in Software Engineering (Mi SE), Gothenburg, Sweden, 2018, p. 33-40.
M. Usman, A. Nadeem and T. Kim, "UJECTOR: A Tool for Executable Code Generation from UML Models," 2008 Advanced Software Engineering and Its Applications, Hainan Island, 2008, p. 165-170.
N. S. Bhullar, B. Chhabra and A. Verma, "Exploration of UML diagrams based code generation methods," 2016 International Conference on Inventive Computation Technologies(ICICT), Coimbatore, 2016, p. 1-6.
G. A. Papadopoulos, "Automatic code generation: A practical approach," ITI 2008 - 30th International Conference on Information Technology Interfaces, Dubrovnik, 2008, p. 861-866.
S. E. Viswanathan and P. Samuel, "Automatic code generation using unified modeling language activity and sequence models," in IET Software, vol. 10, no. 6, p. 164-172, 12 2016.
A. Tarasiev, M. Filippova, K. Aksyonov and O. Aksyonova, "Developing Prototype of CASE-Tool to Create Automation Systems Based on Web Applications Using Code Generation," 2018 Dynamics of Systems, Mechanisms and Machines (Dynamics), Omsk, 2018, p. 1-4.
M. K. Shiferaw and A. K. Jena, "Code Generator for Model- Driven Software Development Using UML Models," 2018 Second International Conference on Electronics, Communication and Aerospace Technology (ICECA), Coimbatore, 2018, p. 1671-1678.
D. Kundu, D. Samanta and R. Mall, "Automatic code generation from unified modelling language sequence diagrams," in IET Software, vol. 7, no. 1, p. 12-28, February 2013.
Dong Hyuk Park, Soo Dong Kim, "XML Rule Based Source Code Generator for UML Case Tool", Asia-Pacific Software Engineering Conference (APSEC2001), p. 53-60, 2001.
Sen Zhang, Lei Deng, Jian Wu, et al. Code Generation Method of Distributed Object Model Framework Based on MDA[J]. Journal of Northwestern Polytechnical University, 2014, 32(1),p. 49-54.
Xiang Chen, Xuebin Wang, Quanyuan Wu. Implementation of Code Generation Technology in MDA[J]. Computer Applied Research, 2006(01),p. 147-150.
H. Benouda, M. Azizi, M. Moussaoui and R. Esbai, "Automatic code generation within MDA approach for cross-platform mobiles apps," 2017 First International Conference on Embedded & Distributed Systems (EDiS), Oran, 2017, p. 1-5.
Qiong Zhang, Pian Huang. XML-based Code Generating Tool[J]. Electronic technology, 2015, 28(02),p. 95-97.
Downloads
Published
Issue
Section
License
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.