Creational Patterns
Singleton Pattern
The Singleton pattern is likely the most famous—and most abused—creational pattern. It restricts a class to a single instance and exposes a global way to access it. Used carefully, …
Prototype Pattern
The Prototype pattern is what you reach for when “just call the constructor again” is too expensive—or too painful to configure repeatedly. Instead of creating new instances from …
Factory Method Pattern
The Factory Method pattern is the one you use when you want to say “give me a transport,” not “new Truck()” or “new Ship()”. It defines an interface for creating objects but lets …
Builder Pattern
The Builder pattern is what you reach for when a constructor has become a small novel of parameters and optional flags. It’s a creational pattern that lets you construct complex …
Abstract Factory Pattern
The Abstract Factory pattern is one of those tools that quietly keeps large systems from turning into a mess of if (platform == ...) checks. It’s a creational pattern that provides …