Design patterns are recurring solutions to problems in object-oriented design. The phrase was introduced to computer science in the 1990s by the text Design Patterns: elements of reusable object-oriented software. The scope of the term remained a matter of dispute into the next decade. Algorithms are not thought of as design patterns, since they solve implementation problems rather than design ones. Typically, a design pattern is thought to encompass a tight interaction of a few classes and objects.
A primary goal of design is to limit the amount of source change needed to change a program's observed behavior, but this can be difficult to achieve if a designer does not understand the implications of a design. The goal of pattern literature is to make the experience of past designers accessible to beginners and others in the field. A book of design patterns presents different solutions in a common format, to provide a language for discussing design issues.
The format has four essential parts, although the names and ordering differ by source:
- Name - the name of the pattern, which eases discussion.
- Problem - the problem the designer faces, given in context.
- Solution - a detailed description of the solution to the problem.
- Consequences - other results, some negative, of applying the pattern.
The original wiki was established largely to facilitate discussion of design patterns.
Poor (yet unfortunately common) solutions to common problems are sometimes known as anti-patterns.
See also amelioration pattern
Fundamental patterns
Creational patterns
- Abstract factory pattern
- Anonymous subroutine objects pattern
- Builder pattern
- Factory method pattern
- Prototype pattern
- Singleton pattern - an object which is unique in its kind in the whole system
Structural patterns
- Adapter pattern
- Bridge pattern
- Composite pattern - a pattern to build large structures
- Container pattern
- Decorator pattern
- Extensibility pattern
- Facade pattern
- Flyweight pattern
- Pipes and filters
- Proxy pattern
Behavioral patterns
- Breadth first recursion
- Chain of responsibility pattern
- Command pattern
- Currying concept
- Event listener
- Interpreter pattern
- Iterator pattern
- Mediator pattern
- Memento pattern
- Observer pattern - one object acts when some value of another objects changes
- State pattern
- Strategy pattern - make an algorithm pluggable
- Template method pattern
- Visitor pattern
- Hierarchical visitor pattern
Concurrency patterns
- Action at a distance pattern
- Balking pattern
- Guarded suspension
- Scheduler pattern
- Read write lock pattern
- Double checked locking pattern
- Disable job requests while running job pattern
RealTime patterns
Related Topics
References
- Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides: Design Patterns, Addison-Wesley, 1995, hardcover, 395 pages, ISBN 0201633612, Design Patterns CD, 1997 ISBN 0201634988
- Frank Buschmann, Regine Meunier, Hans Rohnert, Peter Sommerlad, Michael Stal: Pattern-oriented Software Architecture, Volume 1: A System of Patterns, John Wiley & Sons Ltd., ISBN 0471958697
- Douglas Schmidt: Pattern-oriented Software Architecture. Volume 2: Patterns for Concurrent and Networked Objects, John Wiley & Sons Ltd., ISBN 0471606952
- Alan Shalloway, James R. Trott: Design Patterns Explained: A New Perspective on Object-Oriented Design, Addison-Wesley, ISBN 0201715945
- Martin Fowler: Patterns of Enterprise Application Architecture, Addison-Wesley, ISBN 0321127420
External links
- Java J2EE pattern catalog
- The list of design patterns is entirely based on a wiki page http://c2.com/cgi/wiki?CategoryPattern.
- The definition of design pattern is based on the definition in Design Patterns.
- Many design patterns are described in mgrand's book
- Patterns Catalog
- The Object-Oriented PatternDigest
- Design Pattern Toolkit