DOI QR코드

DOI QR Code

A Method of Generating Code Implementation Model for UML State Diagrams

UML 상태 다이어그램을 위한 코드 구현 모델의 생성 방법

  • Kim, Yun-Ho (Department of Computer Engineering, Andong National University)
  • Received : 2022.09.15
  • Accepted : 2022.10.04
  • Published : 2022.10.31

Abstract

This paper presents a method to generate a model of the code implementation for UML state diagrams. First, it promotes the states of a state machine into objects, and then it structures the behavior model on the mechanism of a state diagram based on State design pattern. Then, it establishes the rules of generating the code implementation, and using the rules, the Java code mode is generated for the implementations of State Diagrams in Java syntax grammar. In addition, Structuring the information of the code model is necessary for generating Java code automatically. The meta information is composed of Meta-Class Model and Meta-Behavior Model, on which we could construct the automatic code generating engine for UML State Diagrams. The implementation model generation method presented in this paper could be used as a stand-alone engine, or included and integrated as a module in the UML tools.

본 논문에서는 UML 상태 다이어그램으로부터 코드 구현 모델을 생성하는 방법을 제시한다. 첫째로 상태 다이어그램의 상태를 객체화하고, 상태 디자인 패턴에 기반하여 동작 메커니즘을 구조화한다. 다음으로 이 구조에 기반하여 컨텍스트 클래스와 이의 인터페이스 역할을 하는 추상 상태 클래스, 그리고 하위 구상 클래스의 구현 코드를 생성하는 규칙들을 설정한다. 이들 규칙들은 Java의 언어 구조에 기반해서, 상태 다이어그램의 상태들과 동작들에 대한 코드 구현 모델을 생성하게 된다. 한편, 코드의 자동 생성을 위해서는 코드 모델로부터 코드 생성을 위해 구조화된 정보가 필요하다. 따라서, 코드 생성을 위한 정보를 메타 클래스 모델과 메타 행위 모델 형태로 구조화하여 구축한다. 이 메타 정보들에 기반하여 상태 다이어그램으로부터 Java 프로그래밍 언어로의 자동 코드 생성을 위한 엔진의 구축이 가능하다. 또한 코드 모델 생성 엔진은 독자적으로 또는 UML 도구의 상태 다이어그램 기능을 지원하는 도구에 통합된 모듈로서 사용될 수 있다.

Keywords

Acknowledgement

This work was supported by a Research Grant of Andong National University.

References

  1. M. I. Mukhtar and B. S. Galadanci, "Automatic code generation from UML diagrams: The-State-of-the-art," Science World Journal, vol. 13, no. 4, pp. 47-60, Feb. 2019.
  2. J. Ali and J. Tanaka, "Implementing the dynamic behavior represented as multiple state diagrams and activity diagrams," ACIS International Journal of Computer and Information Science, vol. 2, no. 1, pp. 24-36, Mar. 2001.
  3. M. Ehl and M. Konersmann, "Model-based Monitoring of Integrated UML State Machine Models and Code," in Proceedings of the Software Engineering 2021 (Satellite Events), Braunschweig/Virtual, Germany, pp. 12, 2021.
  4. O. Badreddin, T. C. Lethbridge, A. Forward, M. Elaasar, H. Aljamaan, and M. A. Garzon, "Enhanced code generation from UML composite state machines," in Proceedings of 2nd International Conference on Model-Driven Engineering and Software Development, Lisbon, Portugal, pp. 235-245, 2014.
  5. S. Viswanathan and P. Samuel, "Translation of Behavioral Models to Java Code and Enhance with State Charts," International Journal of Computer Information Systems and Industrial Management Applications, vol. 6, pp. 294-304, 2014.
  6. M. L. Alvarez, I. Sarachaga, A. Burgos, E. Estevez, and M. Marcos, "A Methodological Approach to Model-Driven Design and Development of Automation Systems," IEEE Transactions on Automation Science and Engineering, vol. 15, no. 1, pp. 67-79, Jan. 2018. https://doi.org/10.1109/TASE.2016.2574644
  7. V. C. Pham, A. Radermacher, S. Gerard, and S. Li, "Complete Code Generation from UML State Machine," in Proceedings of 5th International Conference on Modeldriven Engineering and Software Development, Porto, Portugal, pp. 208-219, 2017.
  8. E. Gamma, R. Helm, R. Johnson, and J. Vlissides, Design Patterns: Elements of Reusable Object-Oriented Software, Addison-Wesley, USA, 1996.
  9. Y. Kim, "Information Structuring of Diagram Repository for UML Diagrams," Journal of the Korea Institute of Information and Communication Engineering, vol. 23, no. 12, pp. 1588-1595, Dec. 2019. https://doi.org/10.6109/JKIICE.2019.23.12.1588
  10. S. E. Viswanathan and P. Samuel, "Automatic Code Generation from UML State Chart Diagrams," IEEE Access, vol. 7, pp. 8591-8608, Jan. 2019. https://doi.org/10.1109/ACCESS.2018.2890791
  11. Y. Kim, "A Design of Constructing Diagram Repository for UML Diagram Tools," Journal of the Korea Institute of Information and Communication Engineering, vol. 24, no. 2, pp. 244-251, Feb. 2020. https://doi.org/10.6109/JKIICE.2020.24.2.244
  12. Y. Kim, "A Method of Automatic Code Generation for UML Sequence Diagrams Based on Message Patterns," Journal of the Korea Institute of Information and Communication Engineering, vol. 24, no. 7, pp. 857-865, Jul. 2020. https://doi.org/10.6109/JKIICE.2020.24.7.857