Importing Source Code

reverse_engineering_and_synchronizing

Topics

Topic

Detail

See also

Usage

Reverse Engineering in Enterprise Architect enables you to import existing source code as a single directory or a directory structure, in a variety of code languages, into a UML model; it helps you to examine, for example, the functionality of code libraries for reuse, or to bring the UML model up to date with new code from outside the model, as part of a process called synchronization.

The 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 modeled as operations, and interactions between the Java Classes represented by the appropriate connectors.

Examining the code in a UML model helps you to identify the critical modules containing the code, providing a starting point for understanding the business and system requirements of the existing application and enabling the developers to gain a better overall understanding of the source code.

Several options are available for performing reverse engineering, including:

Whether comments are reverse engineered into notes fields, and how they are formatted if they are
How property methods are recognized
Whether dependencies should be created for operation return and parameter types

 

For further information, see the Source Code Options topic.

It is important to note that if a system is not well designed, simply importing the source into Enterprise Architect does not turn it into an easily understandable UML model.

When working with a poorly designed system it is useful to assess the code in manageable units by examining the individual model packages or elements generated from the code; for example, dragging a specific Class of interest onto a diagram and then using the Insert Related Elements option at one level to determine the Class's immediate relationship to other Classes.

From this point it is possible to create Use Cases that identify the interaction between the source code Classes, enabling an overview of the application's operation.

 

Import Source Code

Import a Directory Structure

Source Code Options

Insert Related Elements

Copyright Ownership

Situations that typically lend themselves to reverse engineering tend to operate on 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

 

If you are examining code that you or your organization do not own or do not have specific permission to copy and edit, you must ensure that you understand and comply with the copyright restrictions on that code before beginning the process of reverse engineering.

 

 

Reference

Enterprise Architect currently supports reverse engineering in the following programming languages:

Topic

Link

Action Script

 

ActionScript

Ada 2005 (Systems Engineering and Ultimate editions)

 

Ada 2005

C

 

C

C#

 

C#

C++

 

C++

CORBA IDL (MDG Technology )

www.sparxsystems.com/resources/mdg_tech/

 

Delphi

 

Delphi

Java

 

Java

PHP

 

PHP

Python

 

Python

SystemC(Systems Engineering and Ultimate editions)

 

SystemC

Verilog (Systems Engineering and Ultimate editions)

 

Verilog

VHDL(Systems Engineering and Ultimate editions)

 

VHDL

Visual Basic

 

Visual Basic

Visual Basic .NET

 

Visual Basic .NET

Enterprise Architect  can also reverse engineer certain types of binary files - Java .jar files and .NET PE files; see Import Binary Module for more information.

Notes

In the Corporate, Business and Software Engineering, System Engineering and Ultimate editions of Enterprise Architect, if security is enabled you must have Reverse Engineer From DDL And Source Code permission to reverse engineer source code and synchronize model elements against code
Reverse Engineering of other languages is currently available through the use of MDG Technologies from www.sparxsystems.com/resources/mdg_tech/

Learn more

 

Learning Center topics

(Alt + F1) | Software Engineering | Import Code