StarUML usage document

Preface

Recently I am learning design patterns. Many design patterns can be represented by UML class diagrams; so I learned about the tool StarUMl. In the process of using it, because I am not proficient, some functions are obviously already used, but when I use it again in a few days, I always have to I think for a long time or have to try several times, so I have today’s article;

Overview

StarUML (SU for short) is a tool for creating UML class diagrams, generating class diagrams and other types of unified modeling language (UML) diagrams. StarUML is one of an open source project that has fast development, flexibility and scalability (zj).

Features

1. 9 UML diagrams can be drawn: use case diagram, class diagram, sequence diagram, state diagram, activity diagram, communication diagram, component diagram, deployment diagram and composite structure diagram, etc.

2. Multi-format image files: image files in JPG, JPEG, BMP, EMF and WMF formats can be exported.

Official download address

Address: http://staruml.io/download

The version I installed is: 3.2.2

Introduction to StarUML interface

Mainly include: menu bar (not shown in the figure below), drawing area (Diagram Area), tool area (Tool Box), property editor area (Property Editor), project structure area (Model Explorer), etc., as shown in the following figure;

New Project

You can see from the above figure that a project (project) is automatically created after starting StarUMl. If you don't want to use the default one, you can create a new one. StarUML provides four templates:

File—>New From Template to view or create 

1. UMLMinimal: A single model with UML standard configuration files.

2. UML Conventional: Use case model, analysis model, design model, implementation model and deployment model with UML standard configuration files.

3, 4 + 1 view model: Pilippe Kruchten's 4 + 1 architectural view model.

4. Data Model: A simple data modeling project.

element

Each child item of the ToolBox is called an element. For example, a Class in the ToolBox above is an element

Class Diagram

One, create a class

1. Select the class in the ToolBox , and click the left mouse button in the Diagram Area to create it;

2. Drag the Class on the graph to change the size.

The meaning of each icon is as follows, the ones without numbers and so on;

1. Visibility: change the visibility attribute.

2. Add notes: add link notes.

3. Add attributes: add attributes. Ctrl+Enter

4. Adding method: Adding method Ctrl+Shift+Enter

5. Add template parameters: add template parameters.
 
6. Add reception: add reception.
 

7. Add subcategory: add subcategory.

8. Add super class: add super class.

9. Add the provided interface: add an existing interface.

10. Add the required interface: add the required interface.

11. Add an associated class: add an associated class.

12. Add aggregation class: Add aggregation class.

13. Add a composite class: add a composite class.

14. Add port: add port.

15. Add parts: add parts.

Second, modify the properties of the class

1. Select the view of the class, 2. In the Editor Property, you can modify the class name, visibility, whether it is an abstract class, etc.;

Three, add attributes

1. Right click the view above, Add —>Attritube, select properties

2. Modify the attribute name (mMap) and type (HashMap) 

Add attributes and types completed 

Fourth, add methods and return types

1. Select the Class1 view, do not select the attribute, right click Add —>Operation; modify the method name, visibility, etc., similar to the above attributes;

2. To add parameters to the method, select the method and right-click Add —> Parameter. At this time, Parameter1 is in the selected state and the parameter name and type can be modified (if it is not in the selected state, you can find the parameter that needs to be modified in the Model Explorer and click to select it)

The final display is as follows 

Add return type

1. Add parameters to the method, then select the parameters, modify tpye and direction, as shown below

Editing elements: https://github.com/staruml/staruml-gitbook/blob/master/editing-elements.md on github

Official document: https://docs.staruml.io/working-with-diagrams/class-diagram#class

Five, display the label

The label means that the element is an interface or an abstract class, etc.; the <<Interface>> label as shown in the figure below

1. View of selected interface

2. Modify Editor Styles and select label under format

If the abstract class wants to display the label, you need to enter it in the stereotype, and then display the label;

The display effect is as follows; 

If the method wants to display the label, it is the same operation as the abstract class;

Guess you like

Origin blog.csdn.net/ezconn/article/details/107577049