Make It Fit

Make It Fit: Adapter: The Interpreter Between Two Strangers, Abstract Factory: Parts That Must Match, Choosing a Creational Pattern.

Updated

  1. Adapter: The Interpreter Between Two Strangers (Apprentice): When the hub's routines are written in three brands' words (setPower, release, startStream), every new brand edits every routine; an adapter is a small class that keeps the hub's own promise and passes each call on in the brand's words, so the hub never learns a brand's language.
  2. Abstract Factory: Parts That Must Match (Journeyman): When each brand needs its own connection, command format and status reader, and three separate factories each pick one by the brand's name, one copied line can hand a Bolt lock a Tuneo reader; an abstract factory gives each brand one kit that makes all of its parts, so they can't be mixed.
  3. Choosing a Creational Pattern (Journeyman): By now the course has made objects six ways: a simple factory, a dictionary of functions, Factory Method, Abstract Factory, Builder and Prototype. One look-alike table compares them with plain new, the honest default, so the next object you make gets the way that fits its problem, not the newest pattern you learned.