Creating Objects Under Control
Factory Method and Abstract Factory, Builder and Prototype (with serialization), and Singleton alongside the dependency-injection alternative.
Factory Method and Abstract Factory
Two idiomatic ways to keep object creation out of client code, taught against a carrier integration domain: an Abstract Factory that hands out a matching family of label formatter, rate quoter, and tracking client per carrier, and a Factory Method that lets an onboarding environment decide which integration test suite runs inside a fixed sequence.
Builder, Prototype, and serialization
A fluent builder that assembles a multi-field shipment manifest and validates it only once, at build(), a small named registry of package prototypes that clone into fresh independent copies, and a plain-text serialization format that round-trips a manifest back to an equal value, taught against a freight dispatch domain.
Singleton, and the dependency-injection alternative
The thread-safe Meyers singleton, the real costs it hides behind a convenient accessor, and the constructor-injected abstraction that gives the same capability without the global state, wired by a framework-free composition root.