Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a C++ Class Diagram

In Visual Studio .NET projects you can add a "Class Diagram" to the project which renders a visual representation of all namespaces, classes, methods, and properties. Is there any way to do this for Win32 (not .NET) C++ projects? Either through Visual Studio itself or with a 3rd party tool?

like image 696
Adam Haile Avatar asked Feb 06 '09 19:02

Adam Haile


4 Answers

If you have a Visual Studio 2008 solution composed of multiple C++ projects, you can only generate one class diagram per project.

For example, if you have one application project linking to 10 library projects, you'll have to generate 11 separate class diagrams.

There are two ways to work around this, neither of which is pleasant:

  1. Cram all the source into a single project.
  2. Create a class diagram for one project (the application, perhaps) and then drag files from all the other projects into the class diagram.

A more thorough exploration of the capabilities of the Visual Studio class designer is given in Visual C++ Class Designer.

Given the poor support for C++ class diagrams in Visual Studio, you're probably better off going with a commercial tool if you want anything more than a simple list of what classes you have. WinTranslator from Excel Software might be worth looking at, and someone I work with uses Source Insight.

like image 50
richard.albury Avatar answered Sep 18 '22 04:09

richard.albury


Most UML tools should be able to do that. I know that Sparx Systems Enterprise Architect does.

like image 27
jdisk Avatar answered Sep 19 '22 04:09

jdisk


I've got VS2008 SP1 Professional and class diagrams are working fine for C++ WIN32 and Makefile projects.

like image 27
Jacek Ławrynowicz Avatar answered Sep 18 '22 04:09

Jacek Ławrynowicz


If you're using Visual Studio, class diagrams for C++ were not correctly implemented until Visual Studio 2008.

like image 24
David Anderson Avatar answered Sep 18 '22 04:09

David Anderson