About reverse engineering code to the UML

If you develop projects in Microsoft Visual C++, Microsoft Visual Basic, or Microsoft Visual C#, Visual Studio .NET offers an integrated software modeling solution using Microsoft Office Visio. From within Visual Studio, you can reverse engineer your source code into the Unified Modeling Language (UML); your project's class definitions are used to generate a UML diagram in the Visio environment.

For example, you may have inherited a legacy solution (solution: The file folder that contains templates for particular drawing types. For example, the Project Schedule solution folder contains the Calendar, Gantt Chart, PERT Chart, and Timeline, templates that you use to create those drawing types.) that was developed using Visual Basic or Visual C++. To better understand the structure of the solution, you can open it in Visual Studio .NET and then automatically extract its structures for viewing as elements in a UML static structure (static structure diagram: A diagram that shows the static structure of a model; that is, the elements that exist (such as classes and types), the internal structure of the elements, and their relationships to one another.) diagram. Or, you may have written a new project (project: In Microsoft Visual Basic for Applications (VBA), the code that you write that is saved with a Visio file. You can create only one project for a Visio document, but that project can consist of any number of modules.) in Visual C# (or Visual Basic or Visual C++) and want to view its classes as graphical objects. Using the class definitions in your project, reverse engineering allows you to view the design model for your new project.

ShowReverse engineer a project or an entire solution

You can reverse engineer an entire solution or a selected project within a solution. The selections you make in the Visual Studio Solution Explorer determine what is reverse engineered to the Visio UML.

 Note   Be sure to build the solution in Visual Studio before reverse engineering to help resolve cross-project references.

ShowInitiating reverse engineering in Visual Studio

In the Visual Studio environment, reverse engineering is activated from a command on the Project menu. Information from the code model is extracted, Visio is launched, and reverse-engineered elements of your code appear as icons in the tree view (tree view: Displayed in a window in the UML Navigator, a hierarchy in which each UML element or view (diagram) is represented by an icon. The UML template automatically creates a tree view of your model.) of the Visio UML Model Explorer. You can then drag UML class shapes that reflect class definitions in the source code onto a drawing page to visualize the architecture of the new or legacy solution.

During a reverse engineering operation, status information about the operation is written to the Visual Studio Output window.

ShowLaunching existing Visio files from within Visual Studio

 
 
Applies to:
Visio 2003