El patrón Strategy define una familia de algoritmos/comportamientos intercambiables, encapsula cada uno y los hace intercambiables en tiempo de ejecución. Te permite seleccionar un algoritmo dinámicamente y evitar condicionales complejos, promoviendo código flexible y extensible.
Qué hace el patrón Strategy
STRATEGY → encapsulate INTERCHANGEABLE algorithms/behaviors behind a common interface:
→ define a family of strategies (each implements the same interface)
→ the context uses a strategy via the interface → can SWAP strategies at runtime
→ choose the behavior dynamically without changing the context
→ "compose" behavior instead of hardcoding it (favor composition over conditionals)
