[Gurad, 3(1): January, 2014] ISSN: 2277-9655 Impact Factor: 1.852 http: // www.ijesrt.com(C)International Journal of Engineering Sciences & Research Technology [421-423] IJESRT INTERNATIONAL JOURNAL OF ENGINEERING SCIENCES & RESEARCH TECHNOLOGY An Approach to Code Generation from UML Diagrams Harshal D. Gurad *1 , V. S. Mahalle 2 guradharshal@gmail.com Abstract The Unified Modeling Language (UML) has now become the de-facto industry standard for object-oriented (OO) software development. UML provides a set of diagrams to model structural and behavioral aspects of an object-oriented system. Automatic translation of UML diagrams to object oriented code is highly desirable because it eliminates the chances of introduction of human errors in the translation process. Automatic code generation is efficient which, in turn, helps the software engineers deliver the software on time. However, major challenges in this area include checking consistency of UML models, and ensuring accuracy, maintainability, and efficiency of the generated code. This paper represents an approach to generate efficient and compact executable code from UML diagram. By analyzing the characteristics UML diagram, a coding strategy is proposed, and a structure identification and coding algorithm are put forward for code generation from UML diagram. Based on the coding strategy an algorithm is proposed to generate code from UML diagrams using some intermediate steps. The main objective of this paper is to generate the code from UML diagram. . Keywords: UML, source, code, generation, optimization, preprocessing.XMI. Introduction At present and in the future, the technology development is accompanied by an increase in applications complexity. Code generators are used to increase code quality and decrease envelopment time, since their goal is to generate repetitive source code while maintaining a high consistency level of the generated program code. Code generation assumes the mission of writing repetitive code parts, leaving to programmers more time to concentrate on specific code. The generators provide more productivity; generate great volumes of code, which would take much longer if coded manually. Consistent code quality is preserved throughout the entire generated part of a project. Required coding conventions are consistently applied, unlike handwritten code, where the quality is subject to variation. In case of finding errors in generated code, the errors can be corrected in short time through revising of templates and re-running the process of code generation [4]. Nowadays, there exist many software development tools able to generate source code of basic application skeleton from its formal description unfortunately, in many cases these tools lack an ability to generate complete, production-ready source code defining both the application structure and logic suitable for building without need of any modifications done by a developer.. This paper presents an approach to generate code from UML diagrams. The most important characteristic of this approach is the preserved flexibility towards the target programming language, accomplished by code generation through two transformations; first into an intermediate code and then into the code of a selected target language. Since the complexity of UML model can vary from simple to highly complex, an approach provides an efficient way for generation code from UML diagrams. Related Work In this section, we review existing tools and approaches related to UML-based code generation. The tools such as Omondo EclipseUML[6],Altova Umodel[7],Magic Draw[8],Visual Paradigm[9] support code generation from class diagrams. To generate behavioural diagrams, UML behavioural diagrams such as statechart, collaboration and sequential diagrams are used. Visual Paradigm [9] generates the behavioural code from statechart diagrams using templates for different operations and information associated with the transitions in the statechart diagrams.Niaz and Tanaka[10] propose an approach to generate Java code from UML class and statechart diagrams.Tanaka et al [10,11,12] reports a series of work on code generation from UML statechart diagrams.Engles et al.[13] propose a transformation process based on collaboration diagram to generate Java code.HiberObjects[14] generates code from UML 1.x SDs using templates for specific services supported by different types of object. There are also some existing tools to automatically generate code from UML diagrams such as OCode, JCode, Rhapsody, dcode etc. OCode was developed by Ali and Tanaka [15] to generate Java code