Skip to content

ALL-DESI1002 · design_pattern_fit

Judge whether a design pattern earns its structure.

This is a contextual rule for all languages. Read its implementation.

Compare current variation, change pressure, collaboration, ownership, alternatives, and added indirection with the forces of the proposed or existing pattern. The criteria independently establish recurring variation, existing structure, matched forces, reduced change coupling, and whether direct code is clearer.

Findings cite variants, change sites, collaborators, tests, and simpler alternatives.

Framework contracts may impose a pattern even when project variation is small.

Strategy fits several interchangeable pricing algorithms. A factory around one direct constructor with no variation is likely premature.

  • Cites “Design Patterns”
  • Cites “Refactoring Guru”, design patterns
  • Cites “patos documentation”, pattern contracts