pencilslate
pencilslate

Reputation: 13068

Class library in Visio

How to represent a .net class library and its classes in the Visio? To me, the Package and the Class seems to represent the library and classes respectively. Any suggestions?

Upvotes: 0

Views: 3036

Answers (2)

Tchami
Tchami

Reputation: 4787

Having been a while since I've used Visio, but if I recall correctly packages in Visio are the same as namespaces in .NET. Classes in Visio are the same as classes in .NET.

I'm not sure if this is what you were asking?

However, speaking of Visio and .NET. Certain versions of Visio/Visual Studio allow you to reverse engineer your Visual Studio project and automatically generate a class diagram in Visio. To do this:

  1. Highlight your project in Visual Studio
  2. In the toolbar choose Project -> Visio UML -> Reverse Engineer
  3. Visio will not generate a detailed class diagram based on your Visual Studio project

UPDATE to answer comment:

Normally you'd show a package - class relation ship like this in UML:

package - class relatioship

This is just an example, but it shows a package (or namespace) containing two classes.

This however does not seem to be possible in Visio. What you can do is add a package to your diagram in Visio. Right click on this package in the tree-view, and select New > Class. Then you can drag this class to your diagram which will now look something like this:

package - class relationship in Visio 2007

Also, take a look at this link which has some helpful answers for modeling UML diagrams in Visio (you'll want to look under static structure diagrams).

Hope this answers your question.

Upvotes: 4

Jordi Cabot
Jordi Cabot

Reputation: 8208

Modeling a library of classes in UML can be indeed done by modeling the library as a package and the classes in the library as UML classes belonging to the package. Then, classes will be identified by the combination PackageName::ClassName

To model this in Visio, once you have created the package, you can open model explorer, select the package and with the right button select new->class diagram.

Then a new class diagram will open. All classes created in that class diagram are automatically included as part of the package

Upvotes: 2

Related Questions