370 diagram 符号 Flashcards
inherience
父子关系
extend
可以表达在use case或class diagram里
用三角形空心箭头,箭头放在大头处
generalization
A is type of B 空心三角箭头指向B
比如:the bank customer is type of card holder
和继承一个图形
A is type of B
generalization
«extends»
(use case)add more details in general use case
one use case is a prerequisite of another 或者说 one use case invokes another
«uses/include»
“against”
表示“对比”或“与……比较”
public
protected
private
package(default)
derived
+
#
-
~
/
在UML(统一建模语言)中,derived(派生)属性是一个从其他属性计算或推导得出的属性。它通常使用一个斜杠(/)来表示。例如,一个类的属性标记为/age,意味着这个age属性是基于其他数据(如出生日期)计算得到的,而不是直接存储的。
假设car class里有Customer属性,但customer没有car的属性
unidirectional
unidirectional
one object is related to another object
一根线+单向箭头,箭头放在大头那边,比如car class有个owner customer,则箭头指向customer
在 Class Diagram(类图)中,Association(关联) 指的是类与类之间的一种关系,用来表示它们之间的连接或交互。
Unidirectional Association(单向关联)
单向关联 是一种类之间的关联,其中只有一个方向的连接存在。
含义:A 类知道 B 类的存在,但 B 类不知道 A 类的存在。
表示方法:
在类图中,用带箭头的实线表示单向关联。箭头的指向表示关联的方向。
例如,A → B 表示 A 类持有对 B 类的引用,A 可以访问 B,但 B 不知道 A 的存在。
Student ————-→ Course 学生知道自己的课但是课不知道自己,学生持有课的引用
bidirectional
both know their relationship
双向实现箭头,都有彼此的属性
composition(association)
is entirely made of完全依赖和组成,比如书完全是由page组成,没有page书完全消失
实心方块+实线,方块在大头那边
aggregation(association)
is part of部分组成,比如引擎和车
空心方块和实线,方块在大头(车)那边
0到更多
0或1
only one
1到更多
只有3个
0或5
5到15
0到更多:0..或者
0或1:0..1
only one:1
1到更多:1..*
只有3个:3
0或5:0..5
5到15:5..15
constraint in class diagram
可以在线旁边写,格式:{限制条件}
component
用«component»在方框里标明,右上角画个档案符号(一个方块两个长方块)
required interface标记
半圆的,像受体一样
provided interface
圆形实心不实心都可以
被连接至
be wired to
port(component)
A组件没有直接提供/需求所需的接口,用方块表示
port将组件本身和外部接口(的名字)decoupling
class diagram步骤
- 识别classes,找名词
- 发现名词之间的relationship,基本上识别包含关系的动词,实在识别不了画一条连线,上面写明动词
- 识别multiplicity
- add attributes and methods,识别非包含关系的动词,注意动词发起方
activity node
长方体中间写字
在sequence diagram中如果该(message)方法迭代怎么表示?
在方法前加一个 *
sequence diagram的参与者可以是什么?
actors/普通对象(普通名字:类名)
activity diagram起点和终点的样子
实心圆+空心圆里套个实心圆