当前位置:网站首页>[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 .
边栏推荐
猜你喜欢
![Majority element ii[molar voting method for finding modes]](/img/8f/5925f97c0f5f8c50c19a9ef6d7723c.png)
Majority element ii[molar voting method for finding modes]

剑指 Offer II 035. 最小时间差

Automatic integration: yescomusa, an overseas cross-border e-commerce, cooperates with cloud expansion to realize one-stop Automation Service

vsftp 与 TFTP 与 samba 与 nfs 复习

MySQL advanced 2

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

间歇采样转发干扰

Code analysis platform sonarqube actual combat

Getting started with qpainter: drawing the chess interface

GET 和 POST请求的本质区别是什么?
随机推荐
云呐|固定资产信息系统管理,信息化固定资产管理
GET 和 POST请求的本质区别是什么?
Solr basic operations 15
swift笔记
Web APIs environment object - dark horse programmer
Mysql:sql overview and database system introduction | dark horse programmer
Will the flush SQL CDC parallelism affect the order? Generally, only 1 can be set for data synchronization.
MySQL basics 1
数据中台的五个关键要素
Solr基础操作7
Cloner un Graphe non recté [bfs accède à chaque bord et pas seulement aux noeuds]
【UML】UML的几种关系(依赖-关联-聚合-组合-继承-实现)
MySQL基础2
About SQL: create a view_ XB view, whose function is ① to delete views with duplicate names before creating them ② to display the number of male and female students in this class in the XSB table, and
【PHP】PHP变量内存释放
01背包问题
EB-5 immigration in the United States reappears to be positive, and the reauthorization policy of the regional center is suspended
Code analysis platform sonarqube actual combat
HDCP Paring
IDEA工具快捷键的使用