从 C++ 代码生成 UML?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/405953/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 15:10:22  来源:igfitidea点击:

Generating UML from C++ code?

c++uml

提问by gak

Is there a tool that can parse C++ files within a project and generate UML from it?

是否有可以解析项目中的 C++ 文件并从中生成 UML 的工具?

采纳答案by jwpfox

Here are a few options:

这里有几个选项:

Step-by-Step Guide to Reverse Engineering Code into UML Diagrams with Microsoft Visio 2000 - http://msdn.microsoft.com/en-us/library/aa140255(office.10).aspx

使用 Microsoft Visio 2000 将代码逆向工程代码转换为 UML 图表的分步指南 - http://msdn.microsoft.com/en-us/library/aa140255(office.10).aspx

BoUML - http://bouml.fr/features.html

BoUML - http://bouml.fr/features.html

StarUML - http://staruml.sourceforge.net/en/

StarUML - http://staruml.sourceforge.net/en/

Reverse engineering of the UML class diagram from C++ code in presence of weakly typed containers (2001) - http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.27.9064

在存在弱类型容器的情况下从 C++ 代码逆向工程 UML 类图 (2001) - http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.27.9064

Umbrello UML Modeller - http://uml.sourceforge.net/

Umbrello UML 建模器 - http://uml.sourceforge.net/

A list of other tools to look at - http://plg.uwaterloo.ca/~migod/uml.html

要查看的其他工具列表 - http://plg.uwaterloo.ca/~migod/uml.html

回答by user48956

If its just diagrams that you want, doxygendoes a pretty good job.

如果它只是你想要的图表,doxygen做得很好。

回答by cschol

I believe Enterprise Architectcan do that.

我相信Enterprise Architect可以做到这一点。

回答by Oktalist

I've developed a tool called Doxygraphwhich can parse the XML generated by Doxygen and turn it into an interactive UML class diagram which you can view in a web browser or import into any software that can read Graphviz "dot" files.

我开发了一个名为Doxygraph的工具,它可以解析 Doxygen 生成的 XML 并将其转换为交互式 UML 类图,您可以在 Web 浏览器中查看该类图,也可以将其导入任何可以读取 Graphviz“点”文件的软件。

回答by Rhubbarb

I find that Wikipedia can be a great source of information about such tools, especially for comparison tables. There's a page on UML tools. See in particular the reverse engineered languagescolumn.

我发现维基百科可以成为有关此类工具的重要信息来源,尤其是对于比较表。有一个关于UML 工具的页面。请特别参阅逆向工程语言专栏。

回答by Patrick Johnmeyer

UML Studiodoes this quite well in my experience, and will run in "freeware mode" for small projects.

根据我的经验,UML Studio在这方面做得很好,并且会在小型项目的“免费软件模式”下运行。

回答by Aleksey Kontsevich

Seems Umbrelloproduces best UML from C++ code (suggest to use latest version >= 2.22) comparing to command-line autodiafor Diaand other tools.

与用于Dia和其他工具的命令行autodia相比,似乎Umbrello从 C++ 代码(建议使用最新版本 >= 2.22)生成最佳 UML 。

StarUMLhave not produced good diagrams for me: strange import, not usable, does not work for many people: https://github.com/staruml/Cpp/issues

StarUML没有为我制作好的图表:奇怪的导入,不可用,对很多人不起作用:https: //github.com/staruml/Cpp/issues

回答by Shan

I have used Rational Rose and Rational Rhapsody for reverse engineering large projects. I would prefer Rational Rhapsody for getting the UML class files for C++ !

我已经将 Rational Rose 和 Rational Rhapsody 用于大型项目的逆向工程。我更喜欢 Rational Rhapsody 来获取 C++ 的 UML 类文件!

回答by obecalp

Whoever wants UML deserves Rational Rose:)

谁想要 UML 都值得Rational Rose:)

回答by graham.reeds

StarUMLdoes just that and it is free. Unfortunately it hasn't been updated for a while. There were a couple of offshoot projects (as the project admins wouldn't allow it to be taken over) but they too have died a death.

StarUML就是这样做的,而且它是免费的。可惜好久没更新了。有几个分支项目(因为项目管理员不允许它被接管),但它们也都死了。