如何从现有的Java代码生成UML图(特别是序列图)?
当前回答
我发现绿色插件非常简单,使用和生成类图从源代码。 试一试吧。 只需将插件复制到插件目录。
其他回答
我是作者之一,所以答案可能有偏见。它是开源的(Apache 2.0),但是插件不是免费的。如果你克隆并在本地构建它,你就不需要付费。
在Intellij IDEA上,ZenUML可以从Java代码生成序列图。
请登录https://plugins.jetbrains.com/plugin/12437-zenuml-support查看
源代码:https://github.com/ZenUml/jetbrains-zenuml
ObjectAid UML Explorer
是我用的。它很容易从存储库安装:
Name: ObjectAid UML Explorer
Location: http://www.objectaid.com/update/current
并生成相当不错的UML图:
网站描述:
The ObjectAid UML Explorer is different from other UML tools. It uses the UML notation to show a graphical representation of existing code that is as accurate and up-to-date as your text editor, while being very easy to use. Several unique features make this possible: Your source code and libraries are the model that is displayed, they are not reverse engineered into a different format. If you update your code in Eclipse, your diagram is updated as well; there is no need to reverse engineer source code. Refactoring updates your diagram as well as your source code. When you rename a field or move a class, your diagram simply reflects the changes without going out of sync. All diagrams in your Eclipse workspace are updated with refactoring changes as appropriate. If necessary, they are checked out of your version control system. Diagrams are fully integrated into the Eclipse IDE. You can drag Java classes from any other view onto the diagram, and diagram-related information is shown in other views wherever applicable.
PlantUML怎么样? 这不是逆向工程!!这是在编码之前的工程设计。
我会推荐Omondo的EclipseUML作为一般使用,尽管几个月前我的web项目确实遇到了一些问题。他们曾经有过一个免费版本,但据说已经不再推广了。
如果你真的热衷于从源代码逆向工程序列图,我推荐jTracert。
就Eclipse项目本身而言,Eclipse UML2 Tools项目可能支持逆向工程,尽管我从未见过它在实践中的使用。
MoDisco(模型发现)项目Eclipse GMT项目似乎更清楚地实现了您的目标。特定于技术的工具列表将是一个很好的开始。
另一个Java建模工具是我的网站GitUML。 从存储在GitHub存储库中的Java或Python代码生成UML图。
GitUML的一个关键思想是解决“文档化”的一个问题:图总是过时的。使用GitUML,当您使用git推送代码时,图表会自动更新。
浏览社区UML图,有一些Java设计模式。浏览流行的GitHub存储库,并可视化其中的架构和模式。
使用指向和单击创建图表。没有拖放编辑器,只需点击你想要可视化的存储库树中的类:
底层技术是基于PlantUML的,这意味着您可以使用额外的PlantUML标记来改进您的图表。
推荐文章
- 使用Jackson将JSON字符串转换为漂亮的打印JSON输出
- Android - SPAN_EXCLUSIVE_EXCLUSIVE跨度不能为零长度
- Javadoc @see或{@link}?
- 在准备语句中使用“like”通配符
- Android Eclipse -无法找到*.apk
- javac和Eclipse编译器之间的区别是什么?
- 工厂模式和策略模式之间的区别是什么?
- 在Java中使用正则表达式提取值
- 如何允许所有网络连接类型HTTP和HTTPS在Android(9)馅饼?
- Intellij IDEA Java类在保存时不能自动编译
- 何时使用Mockito.verify()?
- 在maven中安装mvn到底做什么
- 不可变与不可修改的集合
- 如何在JSON中使用杰克逊更改字段名
- GSON -日期格式