Solly
Lesson

Vocabulary: Strategy

Vocabulary after construction: Strategy

The previous exercise began with Expected Behavior and design pressure, not with this name.

The structure that emerged is traditionally called Strategy.

What the reasoning established

  • Stable role: A collaborator capable of apply(value).
  • Change pressure: The shipping fee rule varies independently of orchestration.
  • Ownership/lifetime when relevant: Construct the policy at the composition boundary and inject it; no hidden lookup is required.
  • Structural consequence: The orchestrator owns or receives one collaborator through the smallest useful contract.
  • Runtime topology: run(value) delegates once to policy.apply(value).

Nearby distinction

State: Strategy selects a replaceable algorithm/policy; State changes behavior as an object's owned mode evolves.

Simplify

Ask whether any abstraction can be removed while preserving the original acceptance behavior and design-stress property. If yes, prefer the simpler design.

Use the pattern name to communicate a structure you can already justify. Do not use the name as a recipe that replaces requirements analysis.

Sign in with an enabled provider to save your lesson progress.
Sign in to track progress

Loading sign-in options…