当前位置:网站首页>UML圖記憶技巧
UML圖記憶技巧
2022-07-06 08:49:00 【look-word】
什麼是UML類圖
- Class Diagram:用於錶示類、接口、實例等之間相互的靜態關系
- 雖然名字叫類圖,但類圖中並不只有類
記憶技巧
UML箭頭方向:
從子類指向父類
我相信 很多同學都會有和我一樣的想法,認為子類是以父類為基礎的,箭頭應該父類指向子類
那麼我們改如何去記憶呢?
- 定義子類需要通過extends關鍵字去指定父類
- 子類一定是知到父類定義的,但父類不知道子類的定義
- 只有知道對方的定義才能指向對方
- 所以箭頭的方向是子類指向父類
線的含義
實線 -->繼承 虛線–>實現
- 可以看到 大雁是一個類 實現的某個接口 是由它指向接口 因為接口不知道有大雁的定義
- 鴨是的父類 唐老鴨只是其中的一個子類 所以是由它指向父類鴨

如何記憶呢?
- 空心三角形代錶: 繼承或者實現
- 實現-繼承: is a的關系,擴展目的,不虛,很結實
- 虛線-實現: 虛線代錶 ‘ 需 ’ 無實體
實線 -->關聯 虛線–>依賴
- 關系穩定,實打實的關系,鐵哥們
- 錶示一個類對象和另一個類對象有關聯
- 通常是一個類中有另一個類對象做為屬性
- 可以看到 企鹅的出現是和氣候是有關系的 所以他們是關聯關系

- 虛線–>依賴
- 臨時用一下,若即若離,虛無縹緲,若有若無
- 錶示一種使用關系,一個類需要借助另一個類來實現功能
- 一般是一個類使用另一個類做為參數使用,或作為返回值

菱形
- 菱形就是一個盛東西的器皿(例如盤子)
聚合∶代錶空器皿裏可以放很多相同東西,聚在一起(箭頭方向所指的類)
組合∶代錶滿器皿裏已經有實體結構的存在,生死與共
整體和局部的關系
弱關系
消極的詞:弱-空

整體與局部的關系,和聚合的關系相比,關系更加强烈兩者有相同的生命周期,contains-a的關系
强關系
積極的詞∶强-滿


边栏推荐
- R language uses the principal function of psych package to perform principal component analysis on the specified data set. PCA performs data dimensionality reduction (input as correlation matrix), cus
- Promise 在uniapp的简单使用
- sublime text中conda环境中plt.show无法弹出显示图片的问题
- Sublime text using ctrl+b to run another program without closing other runs
- 如何有效地进行自动化测试?
- LeetCode:836. 矩形重叠
- The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
- China polyether amine Market Forecast and investment strategy report (2022 Edition)
- 电脑F1-F12用途
- @JsonBackReference和@JsonManagedReference(解决对象中存在双向引用导致的无限递归)
猜你喜欢

Screenshot in win10 system, win+prtsc save location

Excellent software testers have these abilities

游戏解包的危害及资源加密的重要性

Tcp/ip protocol

优秀的软件测试人员,都具备这些能力

Unified ordering background interface product description Chinese garbled

Computer cleaning, deleted system files

LeetCode:221. 最大正方形

Promise 在uniapp的简单使用

win10系统中的截图,win+prtSc保存位置
随机推荐
China high purity silver nitrate Market Research and investment strategy report (2022 Edition)
Shift Operators
Screenshot in win10 system, win+prtsc save location
PC easy to use essential software (used)
Niuke winter vacation training 6 maze 2
Purpose of computer F1-F12
Deep analysis of C language pointer
优秀的软件测试人员,都具备这些能力
[embedded] print log using JLINK RTT
What is CSRF (Cross Site Request Forgery)?
Variable length parameter
Unsupported operation exception
LeetCode:124. 二叉树中的最大路径和
Using C language to complete a simple calculator (function pointer array and callback function)
LeetCode:剑指 Offer 03. 数组中重复的数字
游戏解包的危害及资源加密的重要性
Bitwise logical operator
Tcp/ip protocol
Excellent software testers have these abilities
Target detection - pytorch uses mobilenet series (V1, V2, V3) to build yolov4 target detection platform