The Singleton pattern ensures a class has only one instance and provides a global access point to it. Use it when you need exactly one object to coordinate actions across the system — like a configuration manager, logger, or connection pool.
The Factory Method pattern defines an interface for creating objects but lets subclasses decide which class to instantiate. Use it when you want to decouple object creation from usage, making it easy to extend or swap implementations without changing client code.
The Abstract Factory pattern provides an interface for creating families of related objects without specifying their concrete classes. Use it when your system needs to be independent of how its products are created, especially when working with multiple product families.
The Builder pattern separates the construction of a complex object from its representation, allowing the same process to create different representations. Use it when constructing an object requires many steps or configurations that vary independently.
The Prototype pattern creates new objects by copying an existing object (the prototype). Use it when object creation is expensive and a similar object already exists — cloning is faster and more convenient than instantiating from scratch.
The Adapter pattern lets two incompatible interfaces work together by wrapping one of them in a translator object. Use it when you need to integrate a third-party library, a legacy class, or any API whose signature does not match what your code expects.
The Decorator pattern attaches new behavior to an object dynamically by wrapping it in another object that shares its interface. Use it when you want to add cross-cutting features — logging, caching, validation — without subclassing or polluting the base type.
The Facade pattern provides a simple, unified interface to a complex subsystem. Use it when a group of classes is hard to use directly and you want to expose only the high-level operations the rest of the application actually needs.
The Proxy pattern provides a substitute for another object to control access to it. Use it for lazy initialization, access control, caching, or remote invocation — situations where you want to intercept calls without changing the real object.
The Composite pattern lets you treat individual objects and groups of objects uniformly through a common interface. Use it when your data forms a tree — files and folders, UI nodes, organizational hierarchies — and clients should not care whether they're talking to a leaf or a branch.