UML

WHAT IS UML

  • Unified Modeling Language (统一建模语言)
  • 将系统可视化,让规格和设计文档化的表现方法

How to use

类图

  • 类与层次关系
    • 继承
abstract class ParentClass {....}

class ChildClass extends ParentClass{....}

uml 笔记

- 接口与实现

``` java
interface Printable {....}

class PrintClass implements Printable {...}
```

uml 笔记

- 聚合

``` java

class Color {}

class Fruit {
    Color color;
}

class Basket {
    Fruit[] fruits;
}
```

uml 笔记

- 可见性

``` java
class something {
    private int privateField;
    protected int ProtectedField;
    public int publicField;
    private void privateMethod() {}
    protected void protectedMethod() {}
    public void publicMethod() {}
}

 + public
 - private
 # protected
```

uml 笔记

  • 类的关联

uml 笔记

  • 时序图

uml 笔记