Visio 中的类库
如何在 Visio 中表示 .net 类库及其类? 对我来说,包和类似乎分别代表库和类。 有什么建议么?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我使用 Visio 已经有一段时间了,但如果我没记错的话,Visio 中的包与 .NET 中的命名空间相同。 Visio 中的类与 .NET 中的类相同。
不知道你问的是不是这个?
然而,说到 Visio 和 .NET。 某些版本的 Visio/Visual Studio 允许您对 Visual Studio 项目进行逆向工程并在 Visio 中自动生成类图。 为此,请执行以下操作:
更新回答评论:
通常您会在 UML 中显示像这样的包 - 类关系:
这只是一个示例,但它显示了包含两个类的包(或命名空间)。
然而,这在 Visio 中似乎不可能。 您可以做的是将包添加到 Visio 中的图表中。 在树视图中右键单击此包,然后选择“新建”>“新建” 班级。 然后,您可以将此类拖到图表中,图表现在看起来如下所示:
另外,请查看此链接,其中有一些有用的答案在 Visio 中对 UML 图进行建模(您需要查看静态结构图)。
希望这能回答您的问题。
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:
UPDATE to answer comment:
Normally you'd show a package - class relation ship like this in UML:
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:
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.
实际上,可以通过将库建模为包并将库中的类建模为属于该包的 UML 类来对 UML 中的类库进行建模。 然后,类将通过 PackageName::ClassName 组合来标识。
要在 Visio 中对此进行建模,创建包后,您可以打开模型资源管理器,选择包,然后使用右键选择“新建”->“类图”。
然后将打开一个新的类图。 在该类图中创建的所有类都会自动包含在包中
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