Design patterns can be classified in terms of the underlying problem they solve. Examples of problem-based pattern classifications include:
* Fundamental patterns
o Delegation pattern: an object outwardly expresses certain behaviour but in reality delegates responsibility
o Functional design: strives for each modular part of a computer program has only one responsibility and performs that with minimum side effects
o Interface pattern: method for structuring programs so that they're simpler to understand
o Proxy pattern: an object functions as an interface to another, typically more complex, object
o Façade pattern: provides a simplified interface to a larger body of code, such as a class library.
o Composite pattern: defines Composite object (e.g. a shape) designed as a composition of one-or-more similar objects (other kinds of shapes/geometries), all exhibiting similar functionality. The Composite object then exposes properties and methods for child objects manipulation as if it were a simple object.
* Creational patterns which deal with the creation of objects. Abstract Factory and Factory Method are creation patterns
o Abstract factory pattern: centralize decision of what factory to instantiate
o Factory method pattern: centralize creation of an object of a specific type choosing one of several implementations
o Builder pattern: separate the construction of a complex object from its representation so that the same construction process can create different representations
o Lazy initialization pattern: tactic of delaying the creation of an object, the calculation of a value, or some other expensive process until the first time it is needed
o Object pool: avoid expensive acquisition and release of resources by recycling objects that are no longer in use
o Prototype pattern: used when the inherent cost of creating a new object in the standard way (e.g., using the 'new' keyword) is prohibitively expensive for a given application
o Singleton pattern: restrict instantiation of a class to one object
* Structural patterns that ease the design by identifying a simple way to realize relationships between entities. Adapter is a structural pattern
o Adapter pattern: 'adapts' one interface for a class into one that a client expects
o Aggregate pattern: a version of the Composite pattern with methods for aggregation of children
o Bridge pattern: decouple an abstraction from its implementation so that the two can vary independently
o Composite pattern: a tree structure of objects where every object has the same interface
o Decorator pattern: add additional functionality to a class at runtime where subclassing would result in an exponential rise of new classes
o Extensibility pattern: aka. Framework - hide complex code behind a simple interface
o Façade pattern: create a simplified interface of an existing interface to ease usage for common tasks
o Flyweight pattern: a high quantity of objects share a common properties object to save space
o Proxy pattern: a class functioning as an interface to another thing
o Pipes and filters: a chain of processes where the output of each process is the input of the next
o Private class data pattern: restrict accessor/mutator access
* Behavioral patterns that identify common communication patterns between objects and realize these patterns. Interpreter is a behavioral pattern
o Chain of responsibility pattern: Command objects are handled or passed on to other objects by logic-containing processing objects
o Command pattern: Command objects encapsulate an action and its parameters
o Interpreter pattern: Implement a specialized computer language to rapidly solve a specific set of problems
o Iterator pattern: Iterators are used to access the elements of an aggregate object sequentially without exposing its underlying representation
o Mediator pattern: Provides a unified interface to a set of interfaces in a subsystem
o Memento pattern: Provides the ability to restore an object to its previous state (rollback)
o Null Object pattern: Designed to act as a default value of an object
o Observer pattern: aka Publish/Subscribe or Event Listener. Objects register to observe an event which may be raised by another object
o State pattern: A clean way for an object to partially change its type at runtime
o Strategy pattern: Algorithms can be selected on the fly
o Specification pattern: Recombinable Business logic in a boolean fashion
o Template method pattern: Describes the program skeleton of a program
o Visitor pattern: A way to separate an algorithm from an object
o Single-serving visitor pattern: Optimise the implementation of a visitor that is allocated, used only once, and then deleted
o Hierarchical visitor pattern: Provide a way to visit every node in a hierarchical data structure such as a tree.
* Concurrency patterns
o Active Object
o Balking pattern
o Double checked locking pattern
o Guarded suspension
o Leaders/followers pattern
o Monitor Object
o Read write lock pattern
o Scheduler pattern
o Thread pool pattern
o Thread-Specific Storage
o Reactor pattern
[edit] Documentation