Design Pattern Catalog
Compare PatternsCreational
Creation logic is getting complex or scattered
Builder
Separate the construction of a complex object from its representation so the same construction process can create different representations.
Prototype
Specify the kinds of objects to create using a prototypical instance, and create new objects by copying this prototype.
Structural
Fighting component boundaries or external dependencies
Adapter
Convert the interface of a class into another interface clients expect, enabling classes to work together that otherwise could not due to incompatible interfaces.
Facade
Provide a unified, simplified interface to a set of interfaces in a subsystem, making the subsystem easier to use.
Decorator
Attach additional responsibilities to an object dynamically, providing a flexible alternative to subclassing for extending functionality.
Behavioral
Behavior keeps changing, conditionals keep growing
Observer
Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.
Strategy
Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from the clients that use it.
State
Allow an object to alter its behavior when its internal state changes. The object will appear to change its class.
Command
Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations.