Reverse Engineering in Enterprise Architect enables you to import existing source code from a variety of code languages into a UML model. Existing source code structures are mapped into their UML representations, for example a Java class is mapped into a UML class element with the variables being defined as attributes, methods are modeled as operations and the interactions between the Java classes being displayed in the UML model class diagram with the appropriate connectors.
Reverse Engineering enables users to examine legacy code and examine the functionality of code libraries for reuse or to bring the UML model up to date with the code that has been developed as part of a process called synchronization. Examining the code in a UML model enables user to identify the critical modules contained the code, enabling a starting point for understanding of the business and system requirements of the pre-existing system and to enable the developers to gain a better overall understanding of the source code.
To begin the process of importing existing code into Enterprise Architect, an existing source of code must be imported into Enterprise Architect, which can be a single directory or a directory structure. Several options are available when performing the reverse engineering process. The Source Code Engineering options topic contains several options that effect the reverse engineering process. These include:
|·||If comments are reverse engineered into notes fields, and how they are formatted if they are|
|·||How property methods are recognized|
|·||If dependencies should be created for operation return and parameter types.|
It is important to note that when a legacy system has been poorly designed, simply importing the source into Enterprise Architect does not create an easily understood UML model. When working with a legacy system that is poorly designed it is useful to break down the code into manageable components by examining the code elements individually. This can be achieved by importing a specific class of interest into a diagram and then inserting the related elements at one level to determine immediate relationship to other classes. From this point it is possible to create use cases that identify the interaction between the legacy classes, enabling an overview of the legacy systems operation.
Copyright ownership is an important issue to take into account when undertaking the process of reverse engineering. In some cases, software might have specific limitations that prohibit the process of reverse engineering. It is important that a user address the issue of copyright before beginning the process of reverse engineering code. Situations that typically lend themselves to reverse engineering source code include source code that:
|·||You have already developed|
|·||Is part of a third-party library that you have obtained permission to use|
|·||Is part of a framework that your organization uses|
|·||Is being developed on a daily basis by your developers.|
Enterprise Architect currently supports reverse engineering in the following programming languages
Enterprise Architect is also able to reverse engineer certain types of binary files: Java .jar files and .NET PE files. See Import Binary Module for more information.
Note: Reverse Engineering of other languages including CORBA IDL is currently available through the use of MDG Technologies from www.sparxsystems.com/resources/mdg_tech/.