Apply these patterns when designing or refactoring code for modularity, extensibility, and decoupling.
| Hard-coded dependencies | DI, IoC, Service Locator, SAM | | Need runtime extensions | Plugin, Microkernel, Extension Points | | Swappable algorithms | Strategy, Abstract Factory | | Additive behavior | Decorator, Chain of Responsibility, SAM | | Feature coupling | Package by Feature | | Scattered concerns | AOP, Interceptors, Mixins, SAM |
| Temporal coupling | Observer, Event Bus, Event Sourcing, SAM | | Read/write optimization | CQRS | | Deployment flexibility | Feature Toggles, Microservices |
Raccomanda modularità, composizione e modelli di disaccoppiamento per le sfide di progettazione. Da utilizzare durante la progettazione di architetture di plugin, riducendo l'accoppiamento, migliorando la testabilità o separando aspetti trasversali. Fonte: jdubray/puffin.