Creational Patterns
Creational patterns deal with object creation mechanisms, trying to create objects in a manner suitable to the situation. They help make a system independent of how its objects are created, composed, and represented.
Singleton
Ensures a class has only one instance and provides a global point of access to it.
Factory Method
Defines an interface for creating objects, letting subclasses decide which class to instantiate.
Abstract Factory
Provides an interface for creating families of related objects without specifying concrete classes.
Builder
Separates the construction of a complex object from its representation.
Prototype
Creates new objects by copying an existing object (cloning).
Structural Patterns
Structural patterns deal with object composition, creating relationships between objects to form larger structures. They help ensure that when one part of a system changes, the entire structure doesn't need to change.
Adapter
Converts the interface of a class into another interface that clients expect.
Bridge
Decouples an abstraction from its implementation so both can vary independently.
Composite
Composes objects into tree structures to represent part-whole hierarchies.
Decorator
Attaches additional responsibilities to an object dynamically.
Facade
Provides a unified interface to a set of interfaces in a subsystem.
Flyweight
Uses sharing to support large numbers of fine-grained objects efficiently.
Proxy
Provides a surrogate or placeholder for another object to control access to it.
Behavioral Patterns
Behavioral patterns deal with communication between objects, defining how objects interact and distribute responsibility. They help make complex control flows easier to understand and maintain.
Chain of Responsibility
Passes a request along a chain of handlers until one handles it.
Command
Encapsulates a request as an object, allowing parameterization and queuing.
Iterator
Provides a way to access elements of a collection sequentially without exposing its representation.
Mediator
Defines an object that encapsulates how a set of objects interact.
Memento
Captures and externalizes an object's internal state for later restoration.
Observer
Defines a one-to-many dependency so that when one object changes, all dependents are notified.
State
Allows an object to alter its behavior when its internal state changes.
Strategy
Defines a family of algorithms, encapsulates each one, and makes them interchangeable.
Template Method
Defines the skeleton of an algorithm, deferring some steps to subclasses.
Visitor
Represents an operation to be performed on elements of an object structure.
Interpreter
Defines a grammatical representation and an interpreter to deal with this grammar.