I would like to acknowledge the following books that have greatly influenced my understanding of design patterns and software development:
- Mastering Design Patterns by Ta Van Dung (Book Repo, tvd12) (In Vietnamse only)
- Design Patterns: Elements of Reusable Object-Oriented Software by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides (Gang of Four)
- Dive Into Design Patterns by Alexander Shvets (refactoring.guru)
- Clean Code: A Handbook of Agile Software Craftsmanship by Robert C. Martin
Class |
---|
-privateMember: int |
#protectedMember: char |
+publicMember: bool |
────────────────────────── |
+publicMethod(): void |
+publicVirtualMethod(parameter: int): void |
-privateMethod(): bool |
#protectedMethod(value: int): char |
Generalization
| Child Class | is a | Parent Class |
| -kid: bool | ───────────▷ | +virtualMethod(): void |
| +virtualMethod(): void |
Realization
| Class | Implements | Interface |
| -kid: bool | - - - - - -▷ | +virtualMethod(): void |
| +virtualMethod(): void |
Association
1..* 1
| Class 1 | ───────────▶ | Class 2 |
Dependency
<<uses>>
| Class 1 | - - - - - -> | Class 2 |
Aggregation
1 <<has a>> 1..*
| Class 1 | ◇─────────── | Class 2 |
Composition
1 <<owns a>> 1..*
| Class 1 | ◆─────────── | Class 2 |