Generate UML class diagram from code files in Visual Studio
We can generate the UML class diagrams
using the code files with the help of Visual Studio Ultimate version. Here I am
going to show you, how we can do this using Visual Studio 2012 Ultimate version.
Assume that you have two classes called,
Company and Employee
In order to create the URM class diagram
from these two classes, go to ‘Architecture’ menu and click on ‘New Diagram…’
It will launch another dialog called, Add
New Diagram. Select ‘UML Class Diagram’ from the templates section, name your
class diagram project and click on OK button.
And then select ‘Modeling Project’ and give
name for the project, click on OK
Now you will see one more new project in
your solution explorer and UML class design surface window
Open the ‘Architecture Explorer’ from
Architecture -> Windows -> Architecture Explorer
- You will get to see the ‘Class View’ and ‘Solution View’ in architecture explorer in first column.
- On selection of class view, names spaces will display in second column.
- On selection of namespace, all the types from the namespace will display in third column.
- On selection of type, all the members from the type will display in fourth column
Drag the namespaces or types from
architecture explorer to UML class design surface. I have drag and dropped both
Company and Employee objects to UML class design surface as shown below,
From the above picture, you can identify
that class members are marked with some special characters. Where,
- represents private members,
+ represents public members,
# represents protected members and
~ represents internal members
From here you can perform the UML
operations by right-click on either class or class member -> Add,
That’s it! UML class diagrams which are
generated from your code are ready to use in Visual Studio. Hope this helps!
If you have any questions, please feel free
to ask me from the comment box below.
This information is impressive; I am inspired with your post writing style & how continuously you describe this topic. After reading your post, thanks for taking the time to discuss this, I feel happy about it and I love learning more about this topic.
ReplyDeletedot net training institutes in chennai|dotnet training in chennai
Enjoyed reading this post. Visit us at NATA Coaching classes in Hyderabad
ReplyDelete