Moe's Tech Blog

Summary of Design Patterns 본문

Software Design Pattern/Notes

Summary of Design Patterns

moe12825 2022. 8. 22. 06:14
  • 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