Skip to main content

Module 4: Structural & Creational Patterns: Mistake Clinic

This clinic turns wrong moves into reusable judgment. Use it after each practice page and again before the quiz or checkpoint.


Module-Specific Mistake Radar

Start with these traps. Replace or extend them with real mistakes from your own work.

Mistake to look forWhere it shows upSymptomRepair evidence
Finishing Creational Patterns Lab with only a final answerCreational Patterns LabThe work has no failed case, trace, test, proof gap, or design stress point.Add the smallest broken example and show the repair that changes the result.
Finishing Interface Bridging Workshop with only a final answerInterface Bridging WorkshopThe work has no failed case, trace, test, proof gap, or design stress point.Add the smallest broken example and show the repair that changes the result.
Finishing Composition and DI Clinic with only a final answerComposition and DI ClinicThe work has no failed case, trace, test, proof gap, or design stress point.Add the smallest broken example and show the repair that changes the result.
Finishing Code Katas with only a final answerCode KatasThe work has no failed case, trace, test, proof gap, or design stress point.Add the smallest broken example and show the repair that changes the result.
Treating Factory Method as vocabulary instead of a toolFactory MethodThe explanation names the concept but cannot decide between two cases.Write one example, one non-example, and the rule that separates them.
Treating Abstract Factory as vocabulary instead of a toolAbstract FactoryThe explanation names the concept but cannot decide between two cases.Write one example, one non-example, and the rule that separates them.

Practice Mistake Checks

Pull any miss from these checks into your mistake log.

Creational Patterns Lab

Source: practice/01-creational-patterns-lab.md

For each statement, identify the error:

  1. "We have a class with one concrete subclass, so we introduced a Factory Method to stay flexible."
  2. "Our Config is a Singleton because we only ever have one configuration per run."
  3. "Our OrderBuilder validates each field as it is set."
  4. "An Abstract Factory is just a Factory Method with more methods."
  5. "Prototype means deepCopy()."

Interface Bridging Workshop

Source: practice/02-interface-bridging-workshop.md

For each statement, identify the error:

  1. "We wrapped the Stripe SDK in an Adapter that also handles the business rule for failed charges."
  2. "Our Facade hides the subsystem so no one can use it directly."
  3. "We added a Bridge because we expect a second renderer someday."
  4. "Since the Adapter wraps the adaptee, it's the same as a Decorator."
  5. "This class implements both the target and the adaptee interface, so it's a clean object adapter."

Composition and DI Clinic

Source: practice/03-composition-and-di-clinic.md

For each statement, identify the error:

  1. "We use a Decorator to translate our HTTP response into domain objects."
  2. "This class is a Proxy because it just forwards calls to another object."
  3. "Our OrderService looks up its PaymentGateway from a service locator so we can swap it in tests."
  4. "Constructor injection is too verbose, so we made all dependencies public fields and set them after construction."
  5. "Our composition root is a class that every service imports."

Repair Protocol

For each real mistake:

  1. Reproduce the failure on the smallest example, trace, proof, query, command, or design sketch.
  2. Name the hidden assumption.
  3. Repair the artifact.
  4. Save evidence that changed: failing then passing test, corrected proof step, revised diagram, safer command, benchmark, or review note.
  5. Add one retrieval card beginning with Check... before... or Do not use... when....

Mistake Log

DateMistakeSymptomRoot causeRepair evidenceRetrieval card
StarterPick one radar row aboveExplain how it would fail in this moduleName the assumptionAdd a counterexample or corrected artifactWrite the card before closing the page

Completion Standard

  • At least five real mistakes are logged.
  • At least two mistakes include a counterexample or failing test.
  • At least one mistake connects to an older semester skill.
  • At least one correction changes code, a proof, a diagram, a command transcript, a query, or a design decision.