Design pattern (computer science)
Design patterns are standard solutions to common problems in object-oriented software design. The phrase was introduced to computer science in 1995 by the text Design Patterns: Elements of Reusable Object-Oriented Software (ISBN 0201633612). 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 problems. Typically, a design pattern is thought to encompass a tight interaction of a few classes and objects.
Professor Christopher Alexander's work on a pattern language, for designing buildings and communities, was the inspiration for the design patterns of software.
Interest in sharing patterns in the software community has led to a number of books, symposiums, and the formation of Ward Cunningham's original wiki. The goal of pattern literature is to make the experience of experienced designers accessible to beginners and others in the field. A book of design patterns presents different solutions in a common format; it aims to provide a vocabulary for discussing design issues.
The design pattern format has four essential parts, although names and ordering differ by source:
Poor (yet unfortunately common) solutions to common problems are sometimes known as anti-patterns.
See also: amelioration pattern, Model view controller triad
Some feel that the need for patterns results from using computer languages or techniques with insufficient abstraction ability. Under ideal "factoring", a concept should not be copied, but merely referenced. But if something is referenced instead of copied, then there is no "pattern" to label and catalog. It is also said that design patterns encourage navigational database-like structures instead of the allegedly cleaner relational approach where such structures are viewpoints instead of hard-wired into programming code. However, critics of the relational approach suggest that it does not integrate well enough with behavior. The level of coupling that should be supplied between behavior and data is a contentious topic.
Pattern format
Name
Every pattern needs a name, to provide a vocabulary for design discussion.Problem
Recurring circumstances lead to the discovery of this pattern by multiple persons. 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.
Solution
The solution is described sufficiently for implementation by novices, although the implementation is usually given in general enough terms that it can be adapted to different projects.
Consequences
Applying this solution will effect the rest of the project in certain ways, so it is important to mention any common negative or serendipitous side-effects.Similar terms
A List of design patterns
Fundamental patterns
Creational patterns
Structural patterns
Behavioral patterns
Concurrency patterns
Real-time patterns
Critique
Related topics
References
External links