问题描述
我更喜欢在纸上记下UML图,然后使用Java实现它们。如果有一个可以为我创建UML图表的实用程序,我可能会在线共享并包含在数字文档中。换句话说:我想从Java源代码创建UML图。
I prefer to jot down UML-diagrams on paper and then implement them using Java. It would be nice to have a utility which could create UML-diagrams for me which I may share on-line and include in the digital documentation. In other words: I want to create UML diagrams from Java source code.
该实用程序必须能够:
- 在Linux中运行。
- 处理泛型,即在参数和返回类型中正确显示List< Foo>。
- 显示类继承和接口实现。
如果实用程序能够:
- 在Windows和Mac OS X中运行。
- 以一种不错的方式显示枚举。
- 以图表格式生成输出,我可以使用其他实用程序修改。
- 从命令行运行。
- 将UML生成限制为我可以指定的一组包。
- 处理不属于我的源代码的类/接口。它可以包括UML图中外部的第一个类/接口。也许用另一种颜色表示它是由其他人创建的库/框架。
- 专注于此任务,并不试图解决整个文档问题。
- Run in Windows and Mac OS X.
- Display enums in some nice manner.
- Generate output in a diagram format which I may modify using some other utility.
- Run from the command line.
- Restrict the UML generation to a set of packages which I may specify.
- Handle classes/interfaces which are not part of my source code. It could include the first class/interface which is external in the UML diagram. Perhaps in another color to indicate it being a library/framework created by someone else.
- Focuses on this task and doesn't try to solve the whole issue of documentation.
推荐答案
我们尝试过的一种方法是和。我们当时正在做的是让UML创建成为我们CruiseControl构建的自动部分:javadoc将使用内置的UML图构建。它非常漂亮。
One method that we've experimented with is a combination of UMLGraph and GraphViz. What we were doing at the time was making the UML creation an automatic part of our CruiseControl build: the javadoc would be built with UML diagrams built in. It is pretty slick.
我想您会发现几乎可以解答您的所有问题。具体来说,您应该能够从命令行创建所需的类图。
I think you'll find that the UMLGraph documentation answers pretty much all of your questions. Specifically, you should be able to create the class diagram that you want from the command line.
这篇关于在Linux中运行的免费实用程序,用于从Java源文件创建UML类图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!