From 9c13aab590b16577c79467bb6dd35d07d61b9aec Mon Sep 17 00:00:00 2001 From: "chen.yang" Date: Tue, 3 Aug 2021 11:33:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=20Mermaid=20=E7=B1=BB?= =?UTF-8?q?=E5=9B=BE=20=E8=AF=AD=E6=B3=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chen.yang --- .../VSCode/VSCode_Markdown_UML.md | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/Software/Applications/VSCode/VSCode_Markdown_UML.md b/Software/Applications/VSCode/VSCode_Markdown_UML.md index 5973f0d..541d678 100644 --- a/Software/Applications/VSCode/VSCode_Markdown_UML.md +++ b/Software/Applications/VSCode/VSCode_Markdown_UML.md @@ -132,6 +132,71 @@ Class01 : int gorilla Class08 <--> C2: Cool label ``` +### 4.1.语法 + +#### 4.1.1.泛化(Generalization) + +继承、子类与父类 + +```mermaid +classDiagram + +A<|--B +A:+int doing +A:+Can() +B:+flying() +``` + +#### 4.1.2.实现(Realization) + +```mermaid +classDiagram + +class IFlyable{ + <> + + flying() +} +IFlyable<|..Bat +Bat:+flying() +``` + +#### 4.1.3.组合(Composition) + +```mermaid +classDiagram + +Computer *-- CPU + Computer *-- Mainboard + Computer *-- HardDisk + Computer *-- MemeryCard +``` + +#### 4.1.4.聚合(Aggregation) + +```mermaid +classDiagram + +Company o-- Empolyee0 +Company o-- Empolyee1 +``` + +#### 4.1.5.关联(Association) + +```mermaid +classDiagram + +Reader "1..*" -- "1..*" Book +Book "1..*"--> "1"Author +``` + +#### 4.1.6.依赖(Dependency) + +```mermaid +classDiagram + +Animal..>Food +``` + ## 5.Mermaid 横向流程图 ```mermaid