Moe's Tech Blog
Summary of Design Patterns 본문
- Creational Pattern: Involve object instantiation and all provide a way to decouple a client from the object it needs to instantiate
- Structural Pattern: Let you compose classes or objects into larger structures
- Behavioral Pattern: is concerned with how classes and objects interact and distribute responsibility
| Pattern Type | Name | Use Cases |
| Creational | Singleton | |
| Prototype | ||
| Factory | ||
| Builder | ||
| Structural | Facade | 1. Hides complexities of code from client providing easy to understand user interface (like a waiter with a restaurant menu) |
| Proxy | 1. To control access to specific objects (Warehouse and order fulfillment) 2. To defer creation of resource intensive objects until needed (image on web pages) |
|
| Composite | 1. Managing the running of multiple subprograms by their common methods | |
| Adapter | 1. Conversion of the output of a function / api / program to fit to the input of another | |
| Decorator | 1. Web page and web page decorators (authentication, authorization) to reduce number of components / codes used | |
| Behavioral | Template Method | 1. Used to consolidate two or more classes with similar functionalities |
| Observer | ||
| Chain of Responsibility | 1. Used to handle streams of different requests like spam filtering system or oil refinery tower or symptom diagnosis | |
| State | 1. Used to change the behavior of an object based upon the state that it's in at run-time |
'Software Design Pattern > Notes' 카테고리의 다른 글
| [Design Pattern] Template Design Pattern (0) | 2022.08.24 |
|---|---|
| [Design Pattern] Decorator Pattern (0) | 2022.08.22 |
| [Design Pattern] Proxy Pattern (0) | 2022.08.19 |
| [Design Pattern] Composite Pattern (0) | 2022.08.15 |
| [Design Pattern] Adapter Pattern (0) | 2022.08.15 |