TY - GEN
T1 - Code generation from UML statecharts
AU - Niaz, Iftikhar Azim
AU - Tanaka, Jiro
PY - 2003/12/1
Y1 - 2003/12/1
N2 - 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.
AB - 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.
KW - Java
KW - Object composition
KW - Object-oriented analysis and design
KW - Software engineering
KW - State pattern
KW - Statecharts
UR - http://www.scopus.com/inward/record.url?scp=1542748762&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=1542748762&partnerID=8YFLogxK
M3 - Conference contribution
AN - SCOPUS:1542748762
SN - 0889863946
T3 - Proceedings of the IASTED International Conference on Software Engineering and Applications
SP - 315
EP - 321
BT - Proceedings of the Seventh IASTED International Conference on Software Engineering and Applications
A2 - Hamza, M.H.
T2 - Proceedings of the Seventh IASTED International Conference on Software Engineering and Applications
Y2 - 3 November 2003 through 5 November 2003
ER -