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

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

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

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

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


边栏推荐
- 704 binary search
- Deep anatomy of C language -- C language keywords
- What is the role of automated testing frameworks? Shanghai professional third-party software testing company Amway
- TP-LINK 企业路由器 PPTP 配置
- C language double pointer -- classic question type
- Report on Market Research and investment prospects of China's silver powder industry (2022 Edition)
- 如何进行接口测试测?有哪些注意事项?保姆级解读
- ESP8266-RTOS物联网开发
- pytorch查看张量占用内存大小
- 移位运算符
猜你喜欢
随机推荐
egg. JS getting started navigation: installation, use and learning
查看局域网中电脑设备
MYSQL卸载方法与安装方法
The mysqlbinlog command uses
LeetCode:剑指 Offer 42. 连续子数组的最大和
UnsupportedOperationException异常
Deep analysis of C language pointer
The harm of game unpacking and the importance of resource encryption
Mobile phones and computers on the same LAN access each other, IIS settings
@JsonBackReference和@JsonManagedReference(解决对象中存在双向引用导致的无限递归)
TP-LINK enterprise router PPTP configuration
What is the role of automated testing frameworks? Shanghai professional third-party software testing company Amway
Revit 二次开发 HOF 方式调用transaction
How to conduct interface test? What are the precautions? Nanny level interpretation
LeetCode:673. 最长递增子序列的个数
Computer graduation design PHP Zhiduo online learning platform
704 binary search
Revit secondary development Hof method calls transaction
Deep anatomy of C language -- C language keywords
Computer cleaning, deleted system files









