Strategy: shipping options
Pick an algorithm at runtime without the caller knowing which one runs.
Level Intermediate
What you will see
- Two ways to ship, two ways to price
- One method, every rule
- One interface, many prices
- The context delegates
- Choosing a strategy
- When not to use it
Before / after
Base: strategy-base-tsView the diff