Maybe some friends still don’t know how to draw class diagrams in StarUML? So for those who don’t know, hurry up and take a look at the detailed method of drawing class diagrams in StarUML shared by the editor. I hope that by studying this tutorial, it will be helpful to everyone. .
1. Preparation
Enter StarUML and create a new empty project
Modify the file name and module name, create a new package in the module, and create a new ClassDiagram in the package. After it is built, it is as shown in the figure below:
2. Start drawing the interface
Select interface on the left sidebar, click on the canvas, and change the name to product, as shown below
Select the interface and change the lollipop style interface to a two-layer rectangular style:
Add a method to the interface: add–Operation, enter the method name, and select isabstract for both the interface name and method, as shown below:
Add parameters and return values to the interface, right-click the car method, as shown below:
Fill in the return value type in the right column
The drawn interface is as follows:
3. Draw the implementation class
Select the class on the left sidebar, click on the canvas, change the name to Amacar, add Operation, add parameter, select the return type return, void, select Realization in the Composite Structure on the left to connect, indicating that Amacar inherits product. As shown below:
4. Export java code
If you have not configured java in StarUML, there is no option in tools. You can find java through tools-extension Manager, select install, and then restart after the installation is completed. That's it.
The above is the detailed method of drawing class diagrams in StarUML shared by the editor. Friends in need can take a look.