The Unified Modeling Language (UML) statechart diagram is used for modeling the dynamic aspects of systems. The UML statechart diagrams include many concepts that are not present in most popular programming languages, like Java or C++. There exists a gap between high level modeling language and a programming language. There is not a one-to-one mapping between a statechart and its implementation. 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 an approach to generate readable, efficient and compact executable code from the UML statechart diagram in an object-oriented (OO) language like Java using design patterns. By representing states as objects, we extend the state design pattern to implement the hierarchical states using the concept of object composition and delegation. We also propose an approach to implement signal and time events, guards and branches and inte...