Meanings of various symbols in a UML diagram

Source: Internet
Author: User

Basic symbols of a similar graph can be split into dotted lines, arrows, solid lines, hollow right triangles, solid right triangles, hollow diamond and solid diamond. These basic graphs are combined to form the basic symbols of the class graph. The order of these symbols represents the Coupling Degree between classes. The greater the coupling, the higher the coupling.

The dotted line + arrow indicates the dependency, the solid line + arrow indicates the association, the dotted line + the hollow right triangle indicates implements, and the solid line + the hollow right triangle indicates generalization, that is, the inheritance relationship of the class. Solid line + hollow diamond represents the aggregation relationship, and solid line + solid diamond represents the combination relationship.

Note the following when viewing a class chart. In fact, the idea of class diagrams has not been separated from the object-oriented idea. Taking a class as the center, some lines are injected and some lines are shot. The injection line indicates the classes called by the class, and the injection line indicates the classes called by the class, including generalization, association, dependency, aggregation, and combination. This is similar to the description of the graph in discrete mathematics.

1. Class: It is represented by a three-layer rectangle.
The first layer displays the class name. If it is an abstract class, it is displayed in italic.
The second layer is fields and attributes.
The third layer is the class method.
Note that '+' indicates public, '-' indicates private, and '#' indicates protected.

2. Interface: the interface is represented by a two-layer rectangle. The main difference between the interface and the class chart is that the top is displayed <interface>.
The first line is the interface name.
The second line is the interface method.

3. Inheritance class (extends): Expressed by a hollow triangle + solid line.

4. Implemented interfaces (implements): Expressed by a hollow triangle + dotted line

5. Association): Expressed by solid arrows, such as swallow and climate

6. Aggregation): Expressed by hollow diamond + solid arrow
Aggregation: indicates a weak 'owner' relationship. It indicates that object A can contain object B, but object B is not part of object A, such as company and employee.

Composition: Expressed by solid diamond + solid arrow
Combination: the relationship between parts and the whole, and the lifecycle is the same. Example: People and hands

7. Dependency): Expressed by dotted arrows, such as animals and oxygen

8. BaseThe numbers at both ends of the line indicate that the class at the end can have several instances. For example, a bird should have two wings. If a class may contain multiple instances, it is represented by 'n. Association, aggregation, and combination have a base.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.