Recently, I reviewed several design patterns, and saw that everyone's blog is full of Java code + UML view, UML expresses the overall framework, and then shows the specific code, combining point and surface, at a glance. So I also studied the mutual conversion method between Java code and UML model.
1. Commonly used UML modeling tools
- The three major modeling tools can refer to: UML modeling tools Visio, Rational Rose, PowerDesign comparison
- All three can support UML modeling very well. Since it is inconvenient or infeasible to integrate with code IDEs such as Eclipse or IDEA, there is no in-depth study.
Second, Java, UML modeling and reverse tool recommendation
- Twelve open source UML tools recommended: http://developer.51cto.com/art/200911/161814.htm
- UML reverse engineering tools for 6 Java projects: https://www.oschina.net/news/32803/6-java-to-uml-tools
- Open source UML tool recommendation: https://www.cnblogs.com/tk55/p/6194141.html
- All kinds of tools, which are said to be hype, can't be installed in the Eclipse plug-in at all or can't be used after the installation is completed. Let's complain about the confusion of Eclipse plug-in management.
- After tossing for a few days, I found that the effects of the two Eclipse plug-ins, Papyrus and ObjectAid, are ok and basically meet the needs.
3. Use of Papyrus
- Installation reference:
https://www.eclipse.org/papyrus/download.html
https://www.eclipse.org/papyrus/downloads/index.php
https://wiki.eclipse.org/Papyrus_User_Guide#Create_a_new_Model
http://wiki.eclipse.org/Java_reverse_engineering
http://wiki.eclipse.org/Java_Code_Generation - Java reverse generated UML example:
- It can only show the basic interface implementation relationship, which is a bit disappointing. However, the modeling ability of this tool, the ability of the model to generate Java code is very strong. Still highly recommended! ! !
Fourth, the use of ObjectAid
- ObjectAid is mainly used for Java code reverse UML
- Installation reference:
-
https://blog.csdn.net/shifangwannian/article/details/49105375
http://www.objectaid.com/ is easy to use, advanced functions require LICENSE, such as: exporting graphics
http://green.sourceforge.net/ 2011 update
http://plantuml.com/ domestic, continuously updated
http://developer.51cto.com/art/200911/161814.htm
https://www.oschina.net/news/32803/6-java-to-uml-tools
https://www.cnblogs.com/tk55/p/6194141.html - Java reverse generated UML example:
-
- Compared with Papyrus, reverse UML works better and can generate slightly hidden relationships
- In Eclipse, it is recommended to use Papyrus for UML modeling, and use ObjectAid to reverse Java code to UML
5. UML view function of IDEA Ultimate Edition
- This function is only available in the IDEA Ultimate version, which requires payment and can only be tried for free
- Installation reference:
- https://www.jetbrains.com/help/idea/navigating-through-a-diagram-with-the-file-structure-view.html
- https://stackoverflow.com/questions/51786/how-to-generate-uml-diagrams-especially-sequence-diagrams-from-java-code#
- After selecting a package, directory, or Java file, press and hold Ctrl+Alt+U to call up the Diagram view, as follows:
-
- 唉,,,还是商业版本软件好,效果吊炸天,接口与实现、对象委托等关系全部能够分析展示出来!!!