Code generation from UML statecharts

Iftikhar Azim Niaz, Jiro Tanaka

Research output: Chapter in Book/Report/Conference proceedingConference contribution

16 Citations (Scopus)

Abstract

The Unified Modeling Language (UML) statechart diagram is a powerful tool for specifying the dynamic behavior of reactive objects. Generating code from statechart diagrams is a challenging task due to its dynamic nature and because many of the statechart concepts are not supported by the object oriented programming languages. Most of the approaches for implementing UML statecharts diagram either suffer from maintenance problems or implement only a subset of UML statecharts. This paper proposes a new approach to generate efficient and compact executable code from the UML statechart diagram in an object-oriented language like Java using design patterns. In our approach, each state in the statechart becomes a class, which encapsulates all the transitions and actions of the state. The events that have transitions are thus made explicit without using any if or case statement, which leads to a readable, compact and efficient code. The resultant code is easy to maintain. By representing states as objects, we extend the state design pattern to implement the sequential substates and concurrent substates using the concept of object composition and delegation. We also propose an approach to implement compound transitions (fork/join) and history nodes. The proposed approach makes elegant handling of most of the statechart features.

Original languageEnglish
Title of host publicationProceedings of the Seventh IASTED International Conference on Software Engineering and Applications
EditorsM.H. Hamza
Pages315-321
Number of pages7
Publication statusPublished - 2003 Dec 1
EventProceedings of the Seventh IASTED International Conference on Software Engineering and Applications - Marina del Rey, CA, United States
Duration: 2003 Nov 32003 Nov 5

Publication series

NameProceedings of the IASTED International Conference on Software Engineering and Applications
Volume7

Conference

ConferenceProceedings of the Seventh IASTED International Conference on Software Engineering and Applications
CountryUnited States
CityMarina del Rey, CA
Period03/11/303/11/5

    Fingerprint

Keywords

  • Java
  • Object composition
  • Object-oriented analysis and design
  • Software engineering
  • State pattern
  • Statecharts

ASJC Scopus subject areas

  • Engineering(all)

Cite this

Niaz, I. A., & Tanaka, J. (2003). Code generation from UML statecharts. In M. H. Hamza (Ed.), Proceedings of the Seventh IASTED International Conference on Software Engineering and Applications (pp. 315-321). (Proceedings of the IASTED International Conference on Software Engineering and Applications; Vol. 7).