• Sign in to Neowin Faster!

    Create an account on Neowin to contribute and support the site.

  • 0
Sign in to follow this  

How to create UML from code?

Question

Andre S.    1,924

Hi, I've heard that it is possible to create a UML diagram from your code in Visual Studio and I'd like to know how to do that and what versions of Visual Studio support it. I have access to pretty much all existing versions of VS including 2005 Team edition and 2008 Professional, although I only installed 2008 Pro.

Share this post


Link to post
Share on other sites

8 answers to this question

Recommended Posts

  • 0
azcodemonkey    1
Hi, I've heard that it is possible to create a UML diagram from your code in Visual Studio and I'd like to know how to do that and what versions of Visual Studio support it. I have access to pretty much all existing versions of VS including 2005 Team edition and 2008 Professional, although I only installed 2008 Pro.

In your solution explorer, right click on the file, and select "View Class Diagram"

Share this post


Link to post
Share on other sites
  • 0
Andre S.    1,924
In your solution explorer, right click on the file, and select "View Class Diagram"
Whether I right-click on the solution or on the project, in the solution explorer, I don't see that option. Then again, here I'm at school on VS2005 Pro. I'll try it again on VS 2008 Pro when I get back home.

Share this post


Link to post
Share on other sites
  • 0
azcodemonkey    1
Whether I right-click on the solution or on the project, in the solution explorer, I don't see that option. Then again, here I'm at school on VS2005 Pro. I'll try it again on VS 2008 Pro when I get back home.

I no longer have 2005 installed, so I cannot verify, but 2008 definitely has this feature.

Share this post


Link to post
Share on other sites
  • 0
Andre S.    1,924

Ok it works in 2008, but why does it only show relations of inheritance, and not composition or agregation?

Share this post


Link to post
Share on other sites
  • 0
azcodemonkey    1
Ok it works in 2008, but why does it only show relations of inheritance, and not composition or agregation?

Ummm... I don't know. LOL It doesn't even appear to be 100% UML compliant. I don't ever use this aspect of the IDE.

Share this post


Link to post
Share on other sites
  • 0
Doli    566

I remember there is an option to export it to a Visio file and all you had to do was open it in Visio and drag the classes over into the view. It doesnt do the lines for you but it cuts out typing all the stuff for the class.

Im sorry i cant give you the full details because i dont have VS2005 install anymore (or vs2008). Try looking under the "Project" menu in the Class Diagram editor.

Share this post


Link to post
Share on other sites
  • 0
Andre S.    1,924

Is there any (free) tool that could produce a complete (well I'm looking for inheritance, agregation, composition and cardinality) UML class diagram simply by looking at your code?

Share this post


Link to post
Share on other sites
  • 0
azcodemonkey    1
Is there any (free) tool that could produce a complete (well I'm looking for inheritance, agregation, composition and cardinality) UML class diagram simply by looking at your code?

I've seen nothing for .NET that is free and able to reverse engineer. Altova makes one that is inexpensive(compared to other UML editors with reverse engineering capability).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.