The necessary knowledge of drawing class diagrams with PlantUML

The necessary knowledge of drawing class diagrams with PlantUML

Dependency

plantuml: .> //  + 
  • A refers to B
  • It may or may not produce a state, but it is generally used to indicate the latter
  • For example, when the function parameter, or the internal part of the function is useful

Association

plantuml: -> //  + 
  • Is a special dependency (Dependency)
  • Generate state, that is, type A has an instance/field variable B

Aggregation

plantuml: o-   o-> //  (+ )
  • Is a special association (Association)
  • Specifically refers to the association that does not manage the life cycle
  • For example, there is an instance variable of B in A, but B is a singleton

Composition

plantuml: *-   *-> //  (+ )
  • Is a special association (Association)
  • Refers specifically to the association of the management life cycle
  • For example, there is an instance variable of B in A, and B is created in A and destroyed as A is destroyed

Generalization

plantuml: -|> //  + 
  • A generalized to B is equivalent to A inherited from B

Realization

plantuml: .|> //  + 
  • A implements interface B