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