SuperAPI AI Directory

creational-design-patterns

Design & creation

View repository

Updated 10-16 06:52

About this skill

Creational design patterns

Read references/patterns.md before making a recommendation or reviewing an implementation.

Workflow

  1. Identify what varies: one product, a product family, assembly steps, initial state, or lifetime.
  2. Establish whether a constructor, function, or dependency injection already solves the problem.
  3. Choose the narrowest matching pattern and name a credible alternative.
  4. Keep selection and construction at the composition boundary when possible.
  5. Preserve product invariants and make ownership or lifetime explicit.
  6. Test the promised variation: add a fake product, switch a family, build a variant, clone safely, or prove instance cardinality under concurrency.

Use the language's natural construction tools. A pattern's collaboration matters more than class names or inheritance.