Get the App
SLTechnology News&Howtos  ›  Development  › 

What is the symbol of UML class diagram?

Shulou Source: shulou.com Published: 2022-06-02 07:55:08 09月29日 Update

Xiaobian to share with you what UML class diagram symbols, I believe most people do not know how, so share this article for your reference, I hope you have a lot of harvest after reading this article, let us go to understand it together!

UML Class Diagram Symbols Software Engineering

1. Generalization (inheritance)

A solid arrow means inheriting a base class. Class B inherits class A.

2. Realization

The dashed arrow in the UML class diagram symbol represents the implementation of an interface: Class C implements the interface Interface (now appears as a line without the arrow)

3. Association

UML class diagram symbols are divided into one-way and two-way association.

The attributes of associations and classes are similar.

3.1 One-way association: only one class can be accessed from another class (the former has the latter in its properties)

Class B one-way association Class A (objects with attribute A in B)

3.2 Bidirectional association: two classes can access each other (both classes have each other in their attributes)

Class B is associated with Class A (objects with attribute A in B)

Class A is associated with Class B (there is an attribute bs in A that is Set, and Set contains objects of B)

A and B are 1-to-n(n>0) correlations

3.3 aggregate relationship

As you can see from the above figure, the Wheel class plays the role of wheels, aggregating 4 into the Car object

The hollow diamond in the UML class diagram symbol indicates that the Wheel object is not created with the creation of the Car, but destroyed with the destruction.

3.4 Combinatorial relations

As you can see from the figure above, the Company class consists entirely of Department objects.

The solid diamond in the UML class diagram symbol indicates that the Department object is created with the creation of the Company object, and destroyed with the destruction.

4. Dependence

Dependency in UML class diagram notation refers to the invocation relationship between classes, represented by dashed arrows in UML. If class A accesses properties or methods of class B,

Or class A is responsible for instantiating class B, then class A can be said to depend on class B. Unlike associations, there is no need to define attributes of type B in class A.

The above is "UML class diagram symbols what" all the content of this article, thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!

Tags: Association symbols objects attributes arrowheads one-way articles above two between content two-way interface diamond dashed line different similar not much in use most Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn MariaDB Shulou Technology Shulou Tech Info Microsoft