标签:note Mom 逆向 Money 图表 Human Heart UML class
1. understand
保存成.svg,用浏览器打开
全选,然后粘贴至vscode(任一的支持正则的文本编辑器)
替换: +
→\n +
, -
→\n -
最后在markdown的mermaid中手动组装,完成类图
2. 类间关系
interfaceA extends interfaceB
:接口继承接口,这是可以的
classDiagram
direction RL
Animal <|-- Human : 泛化
note for Animal "继承 extends"
class Animal{
-lung
+breathe()
}
ILanguage <|.. Human : 实现
note for ILanguage "implements"
class ILanguage{
<<interface>>
-brain
+talk()
+hear()
+write()
}
Heart --* Human : 组合
note for Heart "强组合contains a\n整体和个体不能独立存在\n生命周期必须相同(级联)"
class Heart{
-Human host
}
Crowd o--"1..*" Human : 聚合
note for Crowd "弱拥有has a\n层级:整体>个体"
class Crowd{
-List~Human~ members
}
Boss "1..*"<--"*" Human : 关联
note for Boss "下属要记住"
Mom "1"--"*" Human : (双向)关联
note for Mom "互相记住"
class Mom{
-Human childInstance
}
Money <.. Human : 依赖
note for Money "Human离开Money\n就无法通过编译\neg:Human内\n调用了Money.earn()"
class Money{
-deposit 存款
+earn()
+buy()
}
class Human{
-Mom momInstance
-Boss bossInstance
-Heart heart
}
标签:note,
Mom,
逆向,
Money,
图表,
Human,
Heart,
UML,
class
From: https://www.cnblogs.com/nolca/p/17854066.html