Lesson
Vocabulary: Factory Method
Vocabulary after construction: Factory Method
The previous exercise began with Expected Behavior and design pressure, not with this name.
The structure that emerged is traditionally called Factory Method.
What the reasoning established
- Stable role: A builder callable owns concrete provider construction.
- Change pressure: Concrete provider selection can grow.
- Ownership/lifetime when relevant: Each factory call creates a fresh provider; the caller/root owns it.
- Structural consequence: A registry maps a stable key to creators.
- Runtime topology: look up one creator, invoke it once.
Nearby distinction
Abstract Factory: Factory Method centralizes selection/creation of a product; Abstract Factory creates a compatible family.
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…