preface

C: In software project development and design, UML (Unified Modeling Language) is a controversial issue. From the perspective of software engineering, design comes before code, just like the construction engineering team does not directly carry out the brick, but draws the design first. From the recent two years of agile development, for the so-called “agile”, many processes in software engineering have been cut, and UML has also become part of the Agile team “cut” existence.

The purpose of this article is not to discuss whether UML is useful or not, but there has recently been a requirement to reverse generate class diagrams for Java projects, and I think many students have come across similar requirements, either for documentation purposes or for a more intuitive understanding of the project structure.

If you are using Intellij IDEA as your project IDE, it comes with UML diagram generation, but the requirement is an Eclipse project and you don’t want to convert it to an Intellij IDEA project.

So, here’s a tutorial on a plug-in that can reverse generate UML diagrams in Eclipse to address this requirement.

Introduction to the

Model Goon is an Eclipse plug-in that implements the design and reverse generation of UML diagrams for Java projects, including class diagrams, interaction diagrams, package dependency diagrams, and so on.

The installation

Two difficulties with the installation are the acquisition of the Model Goon plug-in and the slow installation of the Eclipse plug-in.

The first difficulty, Mr. Cha has solved for you, wechat search: Mr. Cha’s handout, reply: 20210331 in the public account, you can get Model Goon 4.4.1 version.

The second aspect depends on whether your computer knows things or not.

Let’s assume that you have got the Model Goon plugin.

Open Eclipse, click the [Help] menu, and select [Install New Software…] from the menu list that pops up. Install new software.

Then, in the installation dialog that pops up, click [Add… (Add) button, then click [Archive…] (Archive) button.

Browse and select the plug-in package for Model Goon and click the “Open” button.

Then, click [Add], so Eclipse recognizes the list of installable plug-ins in the plug-in package.

Then, check the [ModelGoon] plug-in in the list and click [Next].

Verify that the plug-in to be installed is correct and click [Next].

Before the final installation, we need to accept the terms of the ModelGoon agreement, and then click [Finish] to start the installation.

Then comes the long installation time.

During the installation process, you may get a warning of a problem with the software signature, so just click [Install anyway].

When the installation progress bar is complete, a Restart confirmation dialog will appear. Click Restart Now.

After Eclipse restarts, right-click in the left margin of the resource management window and choose [New] -> [Other…] from the shortcut menu. (Other), in the pop-up dialog box, you can find the installed ModelGoon Diagrams.

use

The Model Goon plug-in is easy to use, so Mr. Chia will only show you a brief demonstration of UML class diagram generation. As for interaction diagrams and package dependency diagrams, you can experience them in your project.

To generate a UML class diagram for a project, simply right-click on the corresponding project and select [New] -> [Other…] in turn. After finding the [ModelGoon Diagrams] plug-in directory in the dialog box, select [Class Diagram].

After clicking [Next], give the class diagram file a name, and then click [Finish].

The Model Goon plug-in creates and opens a FILE in MGC format, from which we can design the UML class diagram.

Mr. Cha has prepared several pseudo-classes [2] to demonstrate the effect. You can also use examples from your previous exercises without having to go through as much trouble as Mr. Cha.

The left class or interface, hold down the left mouse button and drag them one by one to the MGC format file canvas, Model Goon plug-in will automatically generate graphics and relationships. You can put these pictures where you like.

Of course, you can also add components from the Palette to the right of the canvas, such as notes, relational arrows, and so on.

Once the design is done, you can also right-click in the margin of the edit area and save it as a picture.

I suggest you save it as an image, because there is a bug in the Model Goon plugin. If you drag and drag the finished design and then open the file, some of the results may be messed up.

The resources

Five minutes [1] clarify UML: www.nowamagic.net/architectur…

[2] Design Patterns, Chapter 1: Error free Code is Good? — Simple factory pattern, UML class diagram

Afterword.

C: Well, that concludes the introduction and basic use of the Model Goon. The use of Model Goon plug-in is quite simple, but there are some small bugs, if you have a better plug-in can also recommend to the teacher.