Skip to content
Author: ytianle

Design Patterns⚓︎

Design pattern is a reusable solution to a commonly occurring problem in software design. It provides a general framework for solving a particular design problem, which can be adapted to suit the specific needs of a particular application.

Design patterns are typically classified into three categories:

  • Factory Method: for single product creation with multiple subclasses
  • Abstract Factory: for platform-specific, style-specific product families, cross-platform UI
  • Builder: for API, SDK, infra
  • Singleton: for global managers, config, logging
  • Prototype: for game dev, performance optimization, object cloning
  • 2.1 Adapter
  • 2.2 Bridge
  • 2.3 Composite
  • 2.4 Decorator
  • 2.5 Facade
  • 2.6 Flyweight
  • 2.7 Proxy
  • 3.1 Chain of Responsibility
  • 3.2 Command
  • 3.3 Interpreter
  • 3.4 Iterator
  • 3.5 Mediator
  • 3.6 Memento
  • 3.7 Observer
  • 3.8 State
  • 3.9 Strategy
  • 3.10 Template Method
  • 3.11 Visitor

The relationship among them can be seen in picture below: picture 1