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

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

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

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

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


边栏推荐
- The problem and possible causes of the robot's instantaneous return to the origin of the world coordinate during rviz simulation
- Computer graduation design PHP Zhiduo online learning platform
- FairGuard游戏加固:游戏出海热潮下,游戏安全面临新挑战
- Image,cv2读取图片的numpy数组的转换和尺寸resize变化
- Bottom up - physical layer
- Deep anatomy of C language -- C language keywords
- [NVIDIA development board] FAQ (updated from time to time)
- egg. JS getting started navigation: installation, use and learning
- China polyether amine Market Forecast and investment strategy report (2022 Edition)
- Shift Operators
猜你喜欢

Variable length parameter
![[MySQL] limit implements paging](/img/94/2e84a3878e10636460aa0fe0adef67.jpg)
[MySQL] limit implements paging

Screenshot in win10 system, win+prtsc save location

Deep anatomy of C language -- C language keywords

Light of domestic games destroyed by cracking

可变长参数

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

ROS compilation calls the third-party dynamic library (xxx.so)

【嵌入式】Cortex M4F DSP库

【剑指offer】序列化二叉树
随机推荐
How to effectively conduct automated testing?
Detailed explanation of heap sorting
TDengine 社区问题双周精选 | 第三期
Swagger setting field required is mandatory
C语言双指针——经典题型
Function coritization
POI add write excel file
Navicat premium create MySQL create stored procedure
Analysis of the source code of cocos2d-x for mobile game security (mobile game reverse and protection)
Double pointeur en langage C - - modèle classique
企微服务商平台收费接口对接教程
vb.net 随窗口改变,缩放控件大小以及保持相对位置
Deep analysis of C language data storage in memory
LeetCode:26. 删除有序数组中的重复项
如何进行接口测试测?有哪些注意事项?保姆级解读
The harm of game unpacking and the importance of resource encryption
Roguelike游戏成破解重灾区,如何破局?
生成器参数传入参数
Esp8266-rtos IOT development
sublime text的编写程序时的Tab和空格缩进问题