Strategy: Define a family of algorithms, encapsulate each one, and make them interchangeable — the algorithm varies independently from clients that use it. The Strategy pattern defines a family of interchangeable algorithms behind one interface. The code that uses them picks one at runtime without knowing its details. Shipping costs are a typical example. A ShippingCalculator interface with implementations for PostNL, DHL and pick-up lets the checkout call calculate($order) on whichever applies. Adding a new carrier means adding a class, not editing checkout logic.
It replaces long if and switch blocks that choose behaviour based on a type, and makes each variant easy to test in isolation. Laravel uses the idea in its drivers for mail, cache and storage. Only introduce it when there really are several variants; for a single algorithm, a plain function is simpler and just as easy to change later.
Implement proven backend architecture patterns including Clean Architecture, Hexagonal Architecture, and Domain-Driven Design. Use this skill when designing clean architecture for a new microservice, when refactoring a monolith to use bounded contexts, when implementing hexagonal or onion architecture patterns, or when debugging dependency cycles between application layers.
'Cloud design patterns for distributed systems architecture covering 42 industry-standard patterns across reliability, performance, messaging, security, and deployment categories. Use when designing, reviewing, or implementing distributed system architectures.'