views:

495

answers:

6

Is there anything out there that for .NET that can generate UML diagrams from code. Preferably an addin for Visual Studio. Starting work on a mature project that has little architectural documentation can be painful at first. Eventually you get the ins and outs of the code but helping to see how the code all fits together from the get go would be wonderful.

A: 

In visual studio 2005/8 you can right click on a class and then select View in Class Diagram which will create a new ClassDiagram containing the selected class and any related classes.

James Boother
+1  A: 

If you have Visio and select Project->Visio UML->Reverse engineer you will get a uml of the project. Sparx Systems has made a product called "Enterprise Architect" that should be able to do the trick as well.

khebbie
+1  A: 

If you generate UML class diagrams for a big project the result is going to be quite chaotic.

Sometimes I use the class diagrams in Visual Studio. I manually add the classes I think deserve some extra explanations. The diagrams are not UML, but it is close enough. They are always up-to-date and you can change the diagram and the code is updated automatically.

To convey the bigger picture of a design I use these UML stencils and draw the diagram by hand. For my points to come across to the people I am communicating with, I find it best to omit irrelevant details, so we can focus on what I think is important. No automatic UML generation tool can figure out which irrelevant details to omit.

Hallgrim
A: 

Class diagram doesn't always work. I often find it wont display the classes for some reason. Pen & pencil or talking with people who work on the project is what I have to rely on.

Crippeoblade
+1  A: 

Visual Studio 2010 Ultimate supports UML class, sequence, component, use case, and activity diagrams. It also supports creating sequence, dependency graphs, and layer diagrams from code. Regarding your question about generating UML diagrams from code, there's a response here in the VS Architecture & Modeling tools forum: Is it possible to reverse engineer C# code into an UML Class Diagram?

Other tools include Architecture Explorer, which lets you browse and explore your solution.

For more info, see the following links:

To download the RC release, visit: Microsoft Visual Studio 2010 Ultimate RC

To see the RC documentation, see Modeling the Application.

To discuss these tools, visit the Visual Studio 2010 Architectural Discovery & Modeling Tools forum.

Esther Fan - MSFT
+1  A: 

Enterprise Architect does this and has an add-in for Visual Studio. It will also do sequence diagrams which can be very useful.

LWoodyiii