
362
|
Chapter 10, Work with Visual Studio Tools
#82 Generate UML Design Documents from Code
HACK
Reverse Engineer Your Code
To get started, you first need to create a Visual Studio Project. This can be
any type of project, and most likely it’s one that you’ve been working on or
have already created. In this hack, I’m going to use the VehicleLibrary exam-
ple found in “Generate Code from UML”
[Hack #81]. To refresh your memory,
the Solution Explorer of that project can be seen in Figure 10-40.
To reverse engineer the code for this project, do the following:
1. Click Project
➝ Visio UML ➝ Reverse Engineer.
2. Browse to the location where you want your Visio file to be saved, give
it a name, and click Save.
3. Depending on the size and complexity of your project, the reverse engi-
neering process may take a moment or two.
4. Once your code has been successfully reverse engineered, an instance of
Visio is automatically started. You can see in the Model Explorer that
your classes have been automatically created (see Figure 10-41).
5. You can also see in your Visual Studio instance that the generated Visio
file has been added to your project under the Solution Items folder.
Create Your Class Diagram
Unfortunately, that’s as far as the reverse engineering will take you. You’ll
have to create the class diagram manually. Depending on the size of your
Figure 10-40. VehicleLibrary project in the Solution Explorer ...