Visual Studio 2010中的UML图生成器 [英] UML diagram generator in Visual Studio 2010

查看:465
本文介绍了Visual Studio 2010中的UML图生成器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的教授要求我们为下一个作业生成UML。我们使用Visual studio 2010进行c ++编程。我试图工作,但我不知道,我去建筑 - > Windows - > UML模型资源管理器,但不明白下一步去哪里。是UML生成器自动创建UML还是只是给一堆盒子来填充关于类和对象的所有信息(手动)?

My professor asked us to generate UML for next homework. We are using Visual studio 2010 for c++ programming. I tried to work on it but I could not figure out, I went to Architecture-> Windows -> UML Model Explorer but don't understand where to go next. Is UML generator creates UML automatically or it will just give bunch of boxes to fill all the information about class and objects (Manually)?

推荐答案

无论哪个版本,Visual Studio 2010都可以 NOT 从C ++代码生成UML类图。任何人声称这一点,没有尝试它:D
请参阅: http://social.msdn.microsoft.com/Forums/en-US/vsarch/thread/2c16410e-9986-49b2-a07c-882b1e5e2b3c

Visual Studio 2010, regardless which edition, can NOT, I repeat, can NOT generate UML class diagrams from C++ code. Anyone who claims this, hasn't tried it :D See here: http://social.msdn.microsoft.com/Forums/en-US/vsarch/thread/2c16410e-9986-49b2-a07c-882b1e5e2b3c

Visual Studio 2010(专业版及更高版本)可以生成类图,但不能生成 UML 类图。相反,他们称之为类图的格式仍然是我不知道的。 类似于UML图,但它实际上不是。要得到这些图,只需右键单击一个项目,选择显示类图并等待它出现(这对我也适用于C + +项目,但我看到其他人报告说,它不工作为他们... 不知道)。这些图表的大底部是

Visual Studio 2010 (also Professional edition and beyond) can generate "class diagrams", but not UML class diagrams. Instead, the format of what they call "class diagram" remains unknown to me. It looks similar to UML diagrams, but it really isn't. To get these diagrams, just right-click a project, select "show class diagram" and wait for it to appear (this does work for me also for C++ projects, but I've seen others reporting that it didn't work for them... no idea). The big down-side of these diagrams is


  • 您必须手动将与其他类的关联转换为关联箭头(通过右键单击成员变量并选择列表中的第一项)

  • 如果您有一个由多个子项目组成的MSVS解决方案,则无法进行此转换,并且生成的图包含具有 子项目中的类的关联

  • that you have to manually turn associations to other classes into association-arrows (by right-clicking the member variable and choosing the first item in the list)
  • this conversion is not possible if you have a MSVS solution that consists of several sub-projects, and the generated diagram contains classes that have associations to classes that are in a different sub-project

对于 C#,您应该能够在解决方案中生成一个新的Modeling项目,在其中创建一个空的UML类图,然后将任何类从任何项目拖动到该类图中(尚未测试它,虽然)。
对此的要求是至少具有MSVS 2010 Ultimate 版本,并具有MSVS Feature Pack 2(这包括从我理解的Feature Pack(1)和可视化和建模工具)。

However, for C# you should be able to generate a new Modeling project in your solution, create an empty UML class diagram inside it, and then drag any class from any project into that class diagram (haven't tested it, though). The requirement for this is at least to have the MSVS 2010 Ultimate version, and to have the MSVS Feature Pack 2 (this includes, from what I understand, Feature Pack (1) and the visualization and modeling tools).

然而,对于C ++,使用此Feature Pack 2,可以创建依赖图,显示.cpp和.hpp文件之间的依赖关系,也相当有用!请参见 http://msdn.microsoft.com/library/ff657798.aspx

For C++ however, using this Feature Pack 2, you can create dependency graphs that shows dependency arrows between .cpp and .hpp files, which is also quite useful! See http://msdn.microsoft.com/library/ff657798.aspx

这篇关于Visual Studio 2010中的UML图生成器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆