当前位置:网站首页>Six relationships of UML class diagram, the best way to learn and understand
Six relationships of UML class diagram, the best way to learn and understand
2022-07-28 01:02:00 【Small target youth】
UML What is it? ?
The more official description is like this :
UML(Unified Modeling Language) It's an open way , Pertaining to 、 visualization 、 Build and write a developing 、 Object oriented 、 Open methods of software intensive system products .
And my description :
UML Count as Between R & D and non R & D For business design Way of communication .
and , Before you write the code , Design must be first .
Code written without thinking ... It's thoughtless .
The class diagram structure

Interface diagram structure

UML Class diagram Of Six relationships
Inherit 、 Realization 、 Combine 、 polymerization 、 relation 、 rely on
Each relationship has its own way of expression , That is to say Line + arrow form
Professional lines and arrows

Professional symbols
Properties and methods “+”、“-” and “#” Indicates access level :
+:public
-:private
#:protected
Combined with examples 、 Schematic diagram Study
Inheritance relationships
The inheritance relationship between classes , You must be familiar with , Father and son , Inherit the father and the son .
Icon :

Realization relationship
Implementation relationship between class and interface , You must be no stranger .
Icon :

Aggregate relationship
What is embodied is A object ( School ) Can contain B object ( teacher 、 Student ), but B Object is not A Part of the object .
teacher 、 Student , If the school doesn't exist , They can still exist alone .
Aggregation represents a weak ‘ Have ’ Relationship .
Icon :

synthetic relation
What is embodied is A object ( Phoenix ) Can contain B object ( Wing 、 Claws, etc ).A As a whole , B As part .
If A be without ,B It's gone . The Phoenix is gone , Its wings are also equivalent to missing .
The whole and the part have the same life cycle .
Combination represents a strong ‘ Have ’ Relationship .
Icon :

Connections
Connections , Obviously, there is There are associations between classes , That's it
Two way toTwo way connection .Well, for example , The connection between students and teachers , Students associate with multiple teachers , Teachers can also manage multiple students .
Of course, there are One way Association , That is, students are related to multiple courses , But the course can't actively relate to students .
Actually , There is also a connection between oneself , Self correlation .
Icon :

Dependency relationship
In fact, there is a little similar correlation , however Dependency has a very personal characteristic ,
Namely Methods of one class use objects of another class as parameters .
Icon :
Okay , That's all for this article .
边栏推荐
- Iperf installation and use
- R language uses ggplot2 visualization: use ggpattern package to add custom stripe patterns, shadows, stripes, or other patterns or textures to the grouped bar graph
- How does JMeter solve the problem of garbled code?
- 立即报名 | 云原生技术交流 Meetup 广州站已开启,8 月 6 号与你相遇!
- Jointly create a new chapter in cultural tourism | xinqidian signs a strategic cooperation agreement with Guohua cultural tourism
- Firefox 103, the Firefox browser, has been released to improve performance under high refresh rate displays
- 接口测试实战项目02:读懂接口测试文档,上手操练
- "C language" deep entry rounding & four functions
- Jericho will make a popping sound when turning on, broadcasting a prompt tone, and turning off [chapter]
- Postman download and use tutorial
猜你喜欢

leetcode:1997. 访问完所有房间的第一天【跳跃dp】

一周年创作纪念日,冲吧少年郎

小波变换学习笔记

Maximize activation

The program design questions of the 11th national competition of Bluebridge cup single chip microcomputer

Multithreading & high concurrency (the latest in the whole network: interview questions + map + Notes) the interviewer is calm

Map set

深度刨析数据在内存中的存储

Function related knowledge

Solve maze problem recursively
随机推荐
函数相关知识
Jerry, if you turn on Bluetooth again, one for two. When the mobile phone is connected to the prototype, it will appear and cannot be connected [chapter]
激活最大化
怎么清晰地理解、表达 IaaS 、 PaaS 、 SaaS ?
Ddt+yaml implementation of data driven mechanism based on unittest
Srv6 debut
Count the six weapons of the domestic interface cooperation platform!
推荐系统-精排模型:xDeepFM
C语言程序设计 | offsetof宏的讲解及其模拟实现
Point divide and conquer analysis
Jericho will make a popping sound when turning on, broadcasting a prompt tone, and turning off [chapter]
Network equipment hard core technology insider firewall and security gateway (11) secrets of zero contact office
ASML推出第一代HMI多光束检测机:速度提升600%,适用于5nm及更先进工艺
Firefox 103, the Firefox browser, has been released to improve performance under high refresh rate displays
[BuildRelease Management]Parabuild
C type use of reflection
数组相关知识
Arm发布全新A78/G78/N78内核!还有支持自定义的Cortex-X系列CPU
Focus on demand flow rather than idle people
110. SAP UI5 FileUploader 控件深入介绍 - 为什么需要一个隐藏的 iframe
