Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to understand UML class diagram symbols

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

How to understand UML class diagram symbols, in view of this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.

A brief introduction to UML Class Diagram symbols

Recently, I learned the design pattern and encountered a lot of class diagrams drawn by UML. I went to the Internet to find a lot of explanations about the symbols of UML class diagrams. The details are as follows:

1. Class (Class): represented by a three-layer rectangular box.

The first layer displays the name of the class, or italics if it is an abstract class.

The second layer is the fields and properties.

The third layer is the method of the class.

Notice the previous symbol,'+ 'for public,'-' for private,'#' for protected.

two。 Interface: it is represented by two-layer rectangular boxes, which is mainly different from the class diagram in that it is displayed at the top.

The * line is the interface name.

The second line is the interface method.

3. Inheritance class (extends): represented by hollow triangles + solid lines.

4. Implementation interface (implements): represented by hollow triangle + dashed line

5. Association: represented by solid-line arrows, such as swallows and climate

6. Aggregation: represented by hollow diamond + solid line arrows

Aggregation in UML class diagram symbols: represents a weak 'ownership' relationship, indicating that An objects can contain B objects, but B objects are not part of An objects, such as companies and employees

Composition: UML class diagram symbols are represented by solid diamond + solid line arrows

Combination: the relationship between the part and the whole, and the life cycle is the same. For example: people and hands

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

8. Cardinality: the numbers at both ends of the connection indicate that there can be several instances of a class at this end, for example, a bird should have two wings. If there may be countless instances of a class, it is used to represent. Association, aggregation and combination have cardinality.

This is the answer to the question on how to understand the symbols of the UML class diagram. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report