用于从现有代码创建大型 Java 类图的 Eclipse 插件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12173724/
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
Eclipse Plugin for creating large java class diagrams from existing code
提问by Andrei F
I am looking for an Eclipse Plugin to create large class diagrams from existing Java code (free/open source). I found some plugins that create diagrams from java code and vice-versa, but the project has a large number of packages (about 80) and classes/interfaces (about 1000-1500) and I would like to create a diagram for the whole code, with different options (for eg, not to include the interfaces in the generated diagram or to create diagrams for certain packages). I know that the diagram would be very big, but that is what I really want to represent the project in a single diagram (and omitting unimportant classes, interfaces, packages etc and also members and method names).
我正在寻找一个 Eclipse 插件来从现有的 Java 代码(免费/开源)创建大型类图。我找到了一些从java代码创建图表的插件,反之亦然,但是该项目有大量的包(大约80个)和类/接口(大约1000-1500个),我想为整个代码创建一个图表,具有不同的选项(例如,不在生成的图表中包含接口或为某些包创建图表)。我知道该图会很大,但这正是我真正想要在单个图中表示项目的内容(并省略不重要的类、接口、包等以及成员和方法名称)。
回答by Sai Ye Yan Naing Aye
Try ObjectAid UML Explorer. And you should also try JUPE.
试试ObjectAid UML Explorer。你也应该试试JUPE。
回答by Jonatan Ka?mierczak
The project size is impressive. Before you will start with diagrams, try to answer to the following questions:
项目规模令人印象深刻。在开始绘制图表之前,请尝试回答以下问题:
- how many diagrams will you create (approximately) ?
- how much time do you spent on one diagram (average) ?
- what are total estimated and allowed time effort ?
- is the result worth of the effort ?
- is the structure changing ?
- how much time effort has to be put into diagrams review+fixes after synchronization of model with changed code ?
- how much time effort has to be put into maintenance of diagrams ?
- 您将创建多少个图表(大约)?
- 你在一张图表上花费了多少时间(平均)?
- 估计和允许的总时间是多少?
- 结果值得努力吗?
- 结构在改变吗?
- 将模型与更改的代码同步后,必须在图表+修复中投入多少时间?
- 需要投入多少时间来维护图表?
In case of project of mentioned size, most likely results are not worth of the effort and most likely model and diagrams will be continuously out-dated.
对于上述规模的项目,最有可能的结果是不值得付出努力,而且最有可能的模型和图表将不断过时。
I faced similar situation even with much smaller projects (< 100 class units). I tried some standalone tools - the best was Enterprise Architect(commercial), next - JUDE (currently astah*, but they cut off import functionality from community edition). However, they and other tools didn't discover dependencies, didn't show parametrized types (List<Something>) and didn't show annotations.
即使是小得多的项目(<100 个班级),我也面临类似的情况。我尝试了一些独立的工具 - 最好的是Enterprise Architect(商业),其次是 JUDE(目前是astah*,但他们切断了社区版的导入功能)。但是,它们和其他工具没有发现依赖关系,没有显示参数化类型(List<Something>),也没有显示注释。
So finally I started to use free UML browser/navigator - Class Visualizer. It's like using interactive map versus scanned paper map. It allows to see selected class with all its relations: super-classes, implemented interfaces, sub-classes, referenced classes (associations, dependencies), usages (associations, dependencies). It processes and shows parametrized types and annotations. I can navigate to other classes through relations. Selected class is presented with all details, relations - without. I tried it on projects of your size - diagrams containing hundreds of relations are generated instantly. And its repository is compiled java project, so no problems with synchronization of model with code.
所以最后我开始使用免费的 UML 浏览器/导航器 - Class Visualizer。这就像使用交互式地图与扫描的纸质地图。它允许查看选定的类及其所有关系:超类、实现的接口、子类、引用类(关联、依赖)、用法(关联、依赖)。它处理并显示参数化类型和注释。我可以通过关系导航到其他类。选定的类显示所有细节,关系 - 没有。我在你这样规模的项目上尝试过 - 包含数百个关系的图表会立即生成。并且它的存储库是编译的java项目,因此模型与代码的同步没有问题。