, "Ward cautioned against requiring too much programming at, what he termed, 'the high level of wizards.' He pointed out that a written 'pattern language' can significantly improve the selection and application of abstractions. He proposed a 'radical shift in the burden of design and implementation' basing the new methodology on an adaptation of Christopher Alexander's work in pattern languages and that programming-oriented pattern languages developed at Tektronix has significantly aided their software development efforts." Submitted to the OOPSLA '87 workshop on the Specification and Design for Object-Oriented Programming }} In software engineering, a design pattern is a general repeatable solution to a commonly-occurring problem in software design. A design pattern isn't a finished design that can be transformed directly into code; it is a description or template for how to solve a problem that can be used in many different situations. Object-oriented design patterns typically show relationships and interactions between classes or objects, without specifying the final application classes or objects that are involved. Algorithms are not thought of as design patterns, since they solve computational problems rather than design problems.
Design patterns gained popularity in computer science after the book Design Patterns: Elements of Reusable Object-Oriented Software was published in 1994 (Gamma et al). That same year, the first Pattern Languages of Programs conference was held and the following year, the Portland Pattern Repository was set up for documentation of design patterns. The scope of the term remained a matter of dispute into the next decade.
Often, people only understand how to apply certain software design techniques to certain problems. These techniques are difficult to apply to a broader range of problems. Design patterns provide general solutions, documented in a format that doesn't require specifics tied to a particular problem.
Design patterns are composed of several sections (see Documentation). Of particular interest are the Structure, Participants, and Collaboration sections. These sections describe a design motif: a prototypical micro-architecture that developers copy and adapt to their particular designs to solve the recurrent problem described by the design pattern. (A micro-architecture is a set of program constituents (e.g., classes, methods...) and their relationships.) Developers use the design pattern by introducing in their designs this prototypical micro-architecture, which means that micro-architectures in their designs will have structure and organization similar to the chosen design motif.
In addition, patterns allow developers to communicate using well-known, well understood names for software interactions. Common design patterns can be improved over time, making them more robust than ad-hoc designs.
A commonly used format is the one used by the Gang of Four. It contains the following sections:
This practice is not only common, but institutionalized. For example, in the OO world you hear a good deal about "patterns". I wonder if these patterns are not sometimes evidence of case (c), the human compiler, at work. When I see patterns in my programs, I consider it a sign of trouble. The shape of a program should reflect only the problem it needs to solve. Any other regularity in the code is a sign, to me at least, that I'm using abstractions that aren't powerful enough— often that I'm generating by hand the expansions of some macro that I need to write.
Peter Norvig provides a similar argument - he demonstrates that 16 out of the 23 patterns in the Design Patterns book (which is primarily focused on C++) are simplified or eliminated (via direct language support) in Lisp or Dylan.
Further arguments along this line are discussed on Portland Pattern Repository's wiki.
The idea of a design pattern is an attempt to standardize what are already accepted best practices. In principle this might appear to be beneficial, but in practice it often results in the unnecessary duplication of code. It is almost always a more efficient solution to use a well-factored implementation rather than a "just barely good enough" design pattern.
Since the beginning of computer science concepts have been given a name (like backtracking, or AVL tree) and documented. Patterns as introduced in the Design Patterns book are related to related to guidelines and principlesIn the field of design, there was also previous art for reusing desing structures (model-view-controller architecture [http://rd13doc.cern.ch/Notes/004/Note004-7.html). The only new thing that the Design Patterns book introduced was to structure the documentation in the same sections introduced by Christopher Alexander, but now this original structure is usually ignored. (Including wikipedia. See any of the Structural patterns, for example).
Patrón de diseñu | Dizajn šema (računari) | Návrhový vzor | Design pattern | Entwurfsmuster | Patrón de diseño | Motif de conception | Design pattern | Design pattern (מדעי המחשב) | Projektavimo pavyzdys | Ontwerppatroon | デザインパターン | Design pattern | Wzorzec projektowy (informatyka) | Padrões de projeto de software | Шаблоны проектирования | Design pattern | Suunnittelumalli | Designmönster | Mẫu thiết kế (khoa học máy tính) | Tasarım kalıpları | 软件设计模式
This article is licensed under the GNU Free Documentation License.
It uses material from the
"Design pattern (computer science)".
Home Page • arts • business • computers • games • health • hospitals • home • kids & teens • news • physicians • recreation• reference • regional • science • shopping • society • sports • world