Code generation from UML statecharts

Iftikhar Azim Niaz*, Jiro Tanaka

*Corresponding author for this work

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

21 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
Externally publishedYes
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
Country/TerritoryUnited States
CityMarina del Rey, CA
Period03/11/303/11/5

Keywords

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

ASJC Scopus subject areas

  • Engineering(all)

Fingerprint

Dive into the research topics of 'Code generation from UML statecharts'. Together they form a unique fingerprint.

Cite this