当前位置:网站首页>[UML] several relationships of UML (dependency Association aggregation composition inheritance Implementation)
[UML] several relationships of UML (dependency Association aggregation composition inheritance Implementation)
2022-06-30 00:26:00 【weixin_ forty-three million two hundred and twenty-four thousan】
UML Several relationships :
2.1 Dependency relationship (Dependency)
Dependency is a kind of usage relationship , A change in a particular thing may affect other things that use it , In need of representation One thing uses another Use dependencies when . Most of the time , Dependency is reflected in the fact that the methods of one class use the objects of another class as parameters .
stay UML in , Dependencies are represented by dotted lines with arrows , from The dependent party points to the dependent party .
Dependency instances
In the system implementation phase , Dependencies are usually implemented in three ways
- The first and most commonly used method is to take the object of one class as the parameter of the method in another class as shown in the figure
- The second way is to take the object of another class as its local variable in the method of one class
- The third way is to call another class middle note in a class method.
2.2 Connections (Association)
The most commonly used relationship between classes , It's a structured relationship , be used for Indicates that there is a connection between one type of object and another
Such as cars and tires 、 Master and apprentice 、 Classes and students, etc .
stay UML In class diagram , Use a solid line to connect the classes of objects that are related
In the use of Java When implementing an association , Usually Take the object of one class as a member variable of another class
When using the class diagram to represent the association relationship, you can mark the role name on the association line , Generally, a verb or noun indicating the relationship between the two is used to indicate the role name ( Sometimes the noun is the instance object name ), The two ends of the relationship represent two different roles , Therefore, two role names can be included in an association relationship , The role name is not required , You can add... As needed , The purpose is to make the relationship between classes clearer .
边栏推荐
- 股票网上开户及开户流程怎样?还有,在线开户安全么?
- Solr基础操作15
- 【UML】UML的几种关系(依赖-关联-聚合-组合-继承-实现)
- [advanced C language] file operation (I)
- How to write controller layer code gracefully?
- 云呐|固定资产系统管理的优势,固定资产管理系统有何特点
- swift笔记
- Can't recognize the original appearance
- Finding a job in 2022 is the "last lesson" for graduates
- Solr basic operations 13
猜你喜欢

网工常见面试题分享:Telnet、TTL、路由器与交换机

代码分析平台 SonarQube 实战
![克隆無向圖[bfs訪問每條邊而不止節點]](/img/34/2a1b737b6095293f868ec6aec0ceeb.png)
克隆無向圖[bfs訪問每條邊而不止節點]

单位固定资产怎么管理,行政单位的固定资产应该怎么管理

间歇采样转发干扰

Summarize Flink runtime architecture in simple terms

面试官:为什么数据库连接很消耗资源?我竟然答不上来。。一下懵了!

网络方向哪个发展更好?数据通信工程师学习路线分享

Activity invitation | the Apache Doris community essay and speech solicitation activity has begun!

Vulnhub靶机-MoriartyCorp
随机推荐
Serpentine matrix (array simulates direction, D represents turning)
[review and Book delivery] 6 interesting R language projects for beginners
[rust weekly library] Tokei - a utility for statistics of code lines and other information
自动融合,驰骋海外丨跨境电商YescomUSA携手云扩实现一站式自动化服务
Solr basic operation 8
Sofaregistry source code | data synchronization module analysis
leetcode 416. Partition equal subset sum partition equal subset sum (medium)
Getting started with qpainter: drawing the chess interface
C MDI open subform to remove automatically generated menu bar
公司固定资产该哪个部门管理,一般公司固定资产怎么管理
将日志文件存储至 RAM 以降低物理存储损耗
Solr基础操作15
请指教在线开户是什么意思?另外想问,现在在线开户安全么?
GET 和 POST请求的本质区别是什么?
关联性——典型相关分析
Rotating colored clover
Mysql:sql overview and database system introduction | dark horse programmer
简要的说一下:Fragment 间的通信方式?
Majority element ii[molar voting method for finding modes]
Sword finger offer II 035 Minimum time difference