Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use UML associated symbols

Shulou Source: shulou.com Published: 2022-06-02 07:56:06 10月05日 Update

This article is to share with you about how to use UML associated symbols. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

UML associated symbol

UML divides the relationships between classes into the following five categories.

◆ association: there is a specific correspondence between the instances of class An and class B.

◆ dependency: class An accesses services provided by class B

◆ aggregation: class An is the whole class, class B is the local class, and the objects of class An are composed of the objects of class B.

◆ generalization: class An inherits class B

◆ implementation: class An implements the B interface

Association (Association)

UML associations refer to specific correspondence between classes, represented by arrows with solid lines in UML. According to the quantity comparison between classes, the association

It can be divided into the following three categories:

◆ one-to-one association

◆ one-to-many association

◆ many-to-many association

Note: UML association should be divided into one-way association and two-way association

Dependency (Dependency)

Dependencies refer to the invocation relationships between classes, represented by arrows with dotted lines in UML. If class An accesses the properties or methods of class B

Or class An is responsible for instantiating class B, then it can be said that class A depends on class B. Unlike association relationships, there is no need to define attributes of class B type in class A.

Aggregation (Aggregation)

Aggregation refers to the relationship between the whole and the parts, which is represented by a diamond arrow with solid lines in UML.

Aggregation relationships can also be divided into two types:

Subsystems where ◆ is aggregated are allowed to be dismantled and replaced, which is a normal aggregation relationship.

The subsystem where ◆ is aggregated is not allowed to be disassembled and replaced. This aggregation is called strong aggregation relationship, or component relationship.

Note: strong aggregation (composition) can be indicated by a solid diamond arrow with solid lines.

Generalization (Generalization)

Generalization refers to the inheritance relationship between classes, represented by triangular arrows with solid lines in UML.

Implement (Realization)

Implementation refers to the relationship between classes and interfaces, represented by triangular arrows with dashed lines in UML.

Thank you for reading! This is the end of this article on "how to use UML associated symbols". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Tags: Associations between arrowheads middle use solid lines symbols triangles content subsystems instances objects properties interfaces whole more articles types diamonds dashed lines triangles Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Shulou Technology macOS Xiaomi NVidia