3

I am designing a simple class library and have already coded some parts of the interfaces/classes.

I would like to use the existing code pieces to display them in the UML diagram.

I could not find a way to do this. I am running Visual Studio 2010 Ultimate.

What are the alternatives to this? creating all classes/interfaces in the diagram from scratch?

What's the point of having the diagram "detached" from the real project?

3
  • Have you tried the class wizard in VS10? Commented Dec 12, 2011 at 15:49
  • What is the class wizard? never came across this... Commented Dec 12, 2011 at 15:59
  • 1
    You can right click your project and choose "view class diagram" option in it.. I think the links below in this thread talk pretty much about it ... Commented Dec 12, 2011 at 16:08

3 Answers 3

2

VS, atleast the version I use, does not have very robust UML support. They do however offer a pretty nifty "class diagram" feature. Maybe that is what you are referring to. You can easily create a class diagram from existing code in one of two ways.

  1. To create a class diagram for an entire project, right click on the project name in the Solution Explorer and click "View Class Diagram"
  2. To create a class diagram for just some classes, add a new item of type class diagram to your project. You can then drag and drop files from the Solution Explorer onto the class diagram canvas.
Sign up to request clarification or add additional context in comments.

Comments

2

Add a class diagram to your solution. Drag and drop files from Solution Explorer or classes from Class Explorer onto the diagram.

From there, you can "grow" the diagram by right-clicking on types and choosing to "Show Base Class" or "Show Derived Classes". Or right-click on properties and fields and choose "Show as Association" or "Show as Collection Association".

1 Comment

Class diagram doesn't show interaction between classes (inheirts/implements/etc)
1

You can add a new item of type ClassDiagram to your project, and then just drag and drop your existing classes there

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.