# Strategy Pattern Confidence: high Last verified: 2026-05-22 Generation: human_only ## TL;DR Encapsulates interchangeable algorithms, making them swappable at runtime. Replaces large if-else chains with polymorphism. Example: sorting strategies, payment methods. ## Core Explanation Context (holds strategy), Strategy (interface), ConcreteStrategies. In functional languages, strategies are just functions — no class hierarchy needed. Key benefit: adding new strategies doesn't modify existing code (Open/Closed Principle). ## Further Reading - [Design Patterns (Gang of Four)](undefined)