当前位置:网站首页>UML图记忆技巧
UML图记忆技巧
2022-07-06 08:47:00 【look-word】
什么是UML类图
- Class Diagram:用于表示类、接口、实例等之间相互的静态关系
- 虽然名字叫类图,但类图中并不只有类
记忆技巧
UML箭头方向:
从子类指向父类
我相信 很多同学都会有和我一样的想法,认为子类是以父类为基础的,箭头应该父类指向子类
那么我们改如何去记忆呢?
- 定义子类需要通过extends关键字去指定父类
- 子类一定是知到父类定义的,但父类不知道子类的定义
- 只有知道对方的定义才能指向对方
- 所以箭头的方向是子类指向父类
线的含义
实线 -->继承 虚线–>实现
- 可以看到 大雁是一个类 实现的某个接口 是由它指向接口 因为接口不知道有大雁的定义
- 鸭是的父类 唐老鸭只是其中的一个子类 所以是由它指向父类鸭
如何记忆呢?
- 空心三角形代表: 继承或者实现
- 实现-继承: is a的关系,扩展目的,不虚,很结实
- 虚线-实现: 虚线代表 ‘ 需 ’ 无实体
实线 -->关联 虚线–>依赖
- 关系稳定,实打实的关系,铁哥们
- 表示一个类对象和另一个类对象有关联
- 通常是一个类中有另一个类对象做为属性
- 可以看到 企鹅的出现是和气候是有关系的 所以他们是关联关系
- 虚线–>依赖
- 临时用一下,若即若离,虚无缥缈,若有若无
- 表示一种使用关系,一个类需要借助另一个类来实现功能
- 一般是一个类使用另一个类做为参数使用,或作为返回值
菱形
- 菱形就是一个盛东西的器皿(例如盘子)
聚合∶代表空器皿里可以放很多相同东西,聚在一起(箭头方向所指的类)
组合∶代表满器皿里已经有实体结构的存在,生死与共
整体和局部的关系
弱关系
消极的词:弱-空
整体与局部的关系,和聚合的关系相比,关系更加强烈两者有相同的生命周期,contains-a的关系
强关系
积极的词∶强-满
边栏推荐
- 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
- Deep analysis of C language data storage in memory
- win10系统中的截图,win+prtSc保存位置
- Mobile phones and computers on the same LAN access each other, IIS settings
- 电脑F1-F12用途
- Unsupported operation exception
- Research Report on Market Research and investment strategy of microcrystalline graphite materials in China (2022 Edition)
- C语言深度解剖——C语言关键字
- The harm of game unpacking and the importance of resource encryption
- Deep analysis of C language pointer
猜你喜欢
目标检测——Pytorch 利用mobilenet系列(v1,v2,v3)搭建yolov4目标检测平台
ROS编译 调用第三方动态库(xxx.so)
PC easy to use essential software (used)
广州推进儿童友好城市建设,将探索学校周边200米设安全区域
MYSQL卸载方法与安装方法
Restful API design specification
vb. Net changes with the window, scales the size of the control and maintains its relative position
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
Deep analysis of C language pointer
vb.net 随窗口改变,缩放控件大小以及保持相对位置
随机推荐
LeetCode:394. 字符串解码
Target detection - pytorch uses mobilenet series (V1, V2, V3) to build yolov4 target detection platform
企微服务商平台收费接口对接教程
After PCD is converted to ply, it cannot be opened in meshlab, prompting error details: ignored EOF
Navicat premium create MySQL create stored procedure
How to effectively conduct automated testing?
torch建立的网络模型使用torchviz显示
Deep analysis of C language pointer
win10系统中的截图,win+prtSc保存位置
704 二分查找
Fairguard game reinforcement: under the upsurge of game going to sea, game security is facing new challenges
Image,cv2读取图片的numpy数组的转换和尺寸resize变化
[NVIDIA development board] FAQ (updated from time to time)
[embedded] cortex m4f DSP Library
sublime text中conda环境中plt.show无法弹出显示图片的问题
LeetCode:39. 组合总和
egg. JS directory structure
The harm of game unpacking and the importance of resource encryption
@Jsonbackreference and @jsonmanagedreference (solve infinite recursion caused by bidirectional references in objects)
【ROS】usb_ Cam camera calibration