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

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

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

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

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


边栏推荐
- JS native implementation shuttle box
- Using pkgbuild:: find in R language_ Rtools check whether rtools is available and use sys The which function checks whether make exists, installs it if not, and binds R and rtools with the writelines
- Philosophical enlightenment from single point to distributed
- On the inverse order problem of 01 knapsack problem in one-dimensional state
- The mysqlbinlog command uses
- LeetCode:673. 最长递增子序列的个数
- hutool优雅解析URL链接并获取参数
- Research Report on Market Research and investment strategy of microcrystalline graphite materials in China (2022 Edition)
- LeetCode:162. 寻找峰值
- ESP8266-RTOS物联网开发
猜你喜欢

Visual implementation and inspection of visdom

Roguelike游戏成破解重灾区,如何破局?

Using C language to complete a simple calculator (function pointer array and callback function)

sublime text中conda环境中plt.show无法弹出显示图片的问题

Using pkgbuild:: find in R language_ Rtools check whether rtools is available and use sys The which function checks whether make exists, installs it if not, and binds R and rtools with the writelines

visdom可视化实现与检查介绍

vb. Net changes with the window, scales the size of the control and maintains its relative position

Double pointeur en langage C - - modèle classique

JVM quick start

Precise query of tree tree
随机推荐
Crash problem of Chrome browser
Unified ordering background interface product description Chinese garbled
LeetCode:41. 缺失的第一个正数
C語言雙指針——經典題型
China polyether amine Market Forecast and investment strategy report (2022 Edition)
Niuke winter vacation training 6 maze 2
poi追加写EXCEL文件
可变长参数
LeetCode:剑指 Offer 03. 数组中重复的数字
PC easy to use essential software (used)
ROS compilation calls the third-party dynamic library (xxx.so)
pytorch训练好的模型在加载和保存过程中的问题
Screenshot in win10 system, win+prtsc save location
JS inheritance method
To effectively improve the quality of software products, find a third-party software evaluation organization
How to effectively conduct automated testing?
sublime text没关闭其他运行就使用CTRL+b运行另外的程序问题
Double pointeur en langage C - - modèle classique
个人电脑好用必备软件(使用过)
Precise query of tree tree