The Dependency rely on
Plantuml:.> // Dotted line + arrow
Copy the code
- A refers to B
- May or may not produce a state, but is generally used to indicate the latter
- For example, when a function argument, or a function part inside, is useful
Association Association
Plantuml: -> // Solid line + arrow
Copy the code
- It’s a special Dependency
- Generate state, i.e., type A has an instance/field variable of B
Aggregation Aggregation
Plantuml: O - or O ->
Copy the code
- It’s a special Association.
- Specifically, associations that do not manage the life cycle
- For example, A has an instance variable of B, but B is A singleton
Composition combination
// Solid diamond (+ arrow)
Copy the code
- It’s a special Association.
- Specifically, managing life cycle associations
- For example, if A has an instance variable of B, B is created in A and destroyed as A is destroyed
Generalization Generalization
Plantuml: - | > / / solid line + hollow arrow
Copy the code
- A generalizing to B is equivalent to A inheriting from B
Realization implementation
Plantuml: | > / / dotted line + hollow arrow
Copy the code
- A implements interface B