NOTE

Strategy Pattern

Encapsulating interchangeable algorithms or policies behind a common contract.

Software Architecture & EngineeringCreated Updated 1 min readhistorical

This is a historical learning note and may contain outdated or incomplete understanding.

Strategy separates a varying algorithm or policy from the context that uses it. Implementations share a contract and can be selected by configuration, runtime state, or dependency injection.

Good strategy boundaries represent real policy variation such as routing, pricing, retry, serialization, or ranking. If only one tiny branch varies, a function/callback may be simpler than a class hierarchy.

Loading helpful count