Jump to content

Design pattern: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Design patterns have essentially nothing to do with computer science
Tags: Mobile edit Mobile web edit
m reads as AI generated (HG) (3.4.12)
 
(36 intermediate revisions by 26 users not shown)
Line 1: Line 1:
{{Short description|Re-usable form of a solution to a design problem}}
{{Redirect|Design patterns|the book|Design Patterns}}
{{Redirect|Design patterns|the book|Design Patterns}}
{{About|a relatively general design concept|application for software development|Software design pattern}}


A '''design pattern''' is the re-usable form of a solution to a design problem. The idea was introduced by the architect [[Christopher Alexander]]<ref name="Alexander, A Pattern Language" >[[#Alexander, A Pattern Language|Alexander, A Pattern Language]]</ref> and has been adapted for various other disciplines, notably [[software engineering]].<ref name="Gang of Four" >[[#Gang of Four|Gamma ''et al.'']], 1994, Design Patterns (the "[[Design Patterns (book)|Gang of Four]]" book)</ref>
A '''design pattern''' is the re-usable form of a solution to a design problem. The idea was introduced by the architect [[Christopher Alexander]]<ref name="Alexander, A Pattern Language" >{{cite book |first=Christopher |last=Alexander |author-link=Christopher Alexander |title=[[A Pattern Language: Towns, Buildings, Construction]] |series=Center for Environmental Structure series |volume=2 |location=New York |publisher=[[Oxford University Press]] |year=1977 |isbn=0-19-501919-9 |oclc=3132495}}</ref> and has been adapted for various other disciplines, particularly [[software engineering]].<ref name="Gang of Four" >{{cite book |title=[[Design Patterns: Elements of Reusable Object-Oriented Software]] |first1=Erich |last1=Gamma |first2=Richard |last2=Helm |first3=Ralph |last3=Johnson |first4=John |last4=Vlissides |series=Addison-Wesley professional computing series |location=Reading, Mass. |publisher=[[Addison-Wesley]] |year=1994 |isbn=0-201-63361-2 |oclc=31171684}} The "[[Design Patterns (book)|Gang of Four]]" book.</ref>


== Details ==
== Details ==
{{Further|Pattern language}}


An organized collection of design patterns that relate to a particular field is called a [[pattern language]]. This language gives a common terminology for discussing the situations designers are faced with.
An organized collection of design patterns that relate to a particular field is called a [[pattern language]]. This language gives a common terminology for discussing the situations designers are faced with.


{{quote|The elements of this language are entities called patterns. Each pattern describes a problem that occurs over and over again in our environment, and then describes the core of the solution to that problem, in such a way that you can use this solution a million times over, without ever doing it the same way twice.Christopher Alexander<ref name="Alexander, A Pattern Language"/>}}
{{Blockquote|The elements of this language are entities called patterns. Each pattern describes a problem that occurs over and over again in our environment, and then describes the core of the solution to that problem, in such a way that you can use this solution a million times over, without ever doing it the same way twice.|author=Christopher Alexander|source=''[[A Pattern Language]]''<ref name="Alexander, A Pattern Language"/>}}


Documenting a pattern requires explaining why a particular situation causes problems, and how the components of the pattern relate to each other to give the solution.<ref>{{cite web | accessdate = 2011-03-21 | author = James Maioriello | date = 2002-10-02 | title = What Are Design Patterns and Do I Need Them? | url = http://www.developer.com/design/article.php/1474561/What-Are-Design-Patterns-and-Do-I-Need-Them.htm}}</ref> [[Christopher Alexander]] describes common design problems as arising from "conflicting forces" — such as the conflict between wanting a room to be sunny and wanting it not to overheat on summer afternoons. A pattern would not tell the designer how many windows to put in the room; instead, it would propose a set of values to guide the designer toward a decision that is best for their particular application. Alexander, for example, suggests that enough windows should be included to direct light all around the room. He considers this a good solution because he believes it increases the enjoyment of the room by its occupants. Other authors might come to different conclusions, if they place higher value on heating costs, or material costs. These values, used by the pattern's author to determine which solution is "best", must also be documented within the pattern.
Documenting a pattern requires explaining why a particular situation causes problems, and how the components of the pattern relate to each other to give the solution.<ref>{{cite web |access-date=2011-03-21 |first=James |last=Maioriello |date=2002-10-02 |title=What are design patterns and do I need them? |url=http://www.developer.com/design/article.php/1474561/What-Are-Design-Patterns-and-Do-I-Need-Them.htm |website=developer.com}}</ref> [[Christopher Alexander]] describes common design problems as arising from "conflicting forces"—such as the conflict between wanting a room to be sunny and wanting it not to overheat on summer afternoons. A pattern would not tell the designer how many windows to put in the room; instead, it would propose a set of values to guide the designer toward a decision that is best for their particular application. Alexander, for example, suggests that enough windows should be included to direct light all around the room. He considers this a good solution because he believes it increases the enjoyment of the room by its occupants. Other authors might come to different conclusions, if they place higher value on heating costs, or material costs. These values, used by the pattern's author to determine which solution is "best", must also be documented within the pattern.


Pattern documentation should also explain when it is applicable. Since two houses may be very different from one another, a design pattern for houses must be broad enough to apply to both of them, but not so vague that it doesn't help the designer make decisions. The range of situations in which a pattern can be used is called its context. Some examples might be "all houses", "all two-story houses", or "all places where people spend time".
Pattern documentation should also explain when it is applicable. Since two houses may be very different from one another, a design pattern for houses must be broad enough to apply to both of them, but not so vague that it doesn't help the designer make decisions. The range of situations in which a pattern can be used is called its context. Some examples might be "all houses", "all two-story houses", or "all places where people spend time".
Line 17: Line 20:
== Examples ==
== Examples ==


* [[Software design pattern]], in software design.
* [[Software design pattern]], in software design
* [[Architectural pattern]], for software architecture.
* [[Architectural pattern]], for software architecture
* [[Interaction design pattern]], used in interaction design / human-computer interaction
* [[Interaction design pattern]], used in interaction design / human–computer interaction
* [[Pedagogical patterns]], in teaching.
* [[Pedagogical patterns]], in teaching
* [[Pattern gardening]], in gardening


Business models also have design patterns.<ref>{{cite journal |vauthors=Mettler T, Eurich M |title=A "design-pattern"-based approach for analyzing e-health business models |journal=Health Policy & Technology |volume=1 |issue=2 |pages=77–85 |year=2012 |doi=10.1016/j.hlpt.2012.04.005 }}</ref><ref>{{cite conference |vauthors=Sprenger M, Mettler T |title=On the Utility of E-Health Business Model Design Patterns |conference=European Conference on Information Systems |year=2016 |url=https://www.alexandria.unisg.ch/248256/ }}</ref>
Business models also have design patterns.<ref>For example: {{cite journal |last1=Mettler |first1=Tobias |last2=Eurich |first2=Markus |date=June 2012 |title=A 'design-pattern'–based approach for analyzing e-health business models |journal=[[Health Policy and Technology]] |volume=1 |issue=2 |pages=77–85 |doi=10.1016/j.hlpt.2012.04.005}}</ref> See {{slink|Business model#Examples}}.


== See also ==
== See also ==
Line 28: Line 32:
* [[Design paradigm]]
* [[Design paradigm]]
* [[Anti-pattern]]
* [[Anti-pattern]]
* [[Dark pattern]]


== References ==
== References ==
{{reflist}}
{{Reflist}}


== Further reading ==
== Further reading ==
{{Refbegin}}
* {{cite book
* {{cite book |last=Erl |first=Thomas |author-link=Thomas Erl |title=SOA Design Patterns |series=Prentice Hall service-oriented computing series from Thomas Erl |publisher=[[Prentice Hall]] |location=Upper Saddle River, NJ |year=2009 |isbn=978-0-13-613516-6 |oclc=156832597}}
|first=Christopher |last=Alexander
* {{cite book |last=Leitner |first=Helmut |date=2015 |title=Pattern Theory: Introduction and Perspectives on the Tracks of Christopher Alexander |series=Pattern research series |volume=1 |location=Graz |publisher=Helmut Leitner, HLS Software |isbn=978-1-5056-3743-4 |oclc=913795677}}
|authorlink=Christopher Alexander
* {{cite book |last=Pree |first=Wolfgang |author-link=Wolfgang Pree |date=1995 |title=Design patterns for object-oriented software development |series=ACM Press books |location=Wokingham, England; Reading, Mass. |publisher=[[Addison-Wesley]] |isbn=0201422948 |oclc=31291883}}
|title=[[A Pattern Language|A Pattern Language: Towns, Buildings, Construction]]
* {{cite book |last1=Schmidt |first1=Douglas C. |author-link2=Douglas C. Schmidt |last2=Buschmann |first2=Frank |last3=Henney |first3=Kevlin |author-link3=Kevlin Henney |date=2007 |title=Pattern-Oriented Software Architecture: On Patterns and Pattern Languages |series=Wiley series in software design patterns |volume=5 |location=Chichester, UK; New York |publisher=[[Wiley (publisher)|Wiley]] |isbn=9780471486480 |oclc=62532759}}
|publisher=[[Oxford University Press]]
* {{cite book |last1=Tidwell |first1=Jenifer |last2=Brewer |first2=Charles |last3=Valencia |first3=Aynne |date=2020 |orig-year=2005 |title=Designing Interfaces: Patterns For Effective Interaction Design |edition=3rd |location=Sebastopol, CA |publisher=[[O'Reilly Media|O'Reilly]] |isbn=9781492051961 |oclc=1138701080 |quote=Presents solutions to common UI design problems as a collection of patterns—each containing concrete examples, recommendations, and warnings.}}
|year=1977
{{Refend}}
|isbn=0-19-501919-9
|ref=Alexander, A Pattern Language
}}
* {{cite book |author= [[Thomas Erl|Erl, Thomas]] |title=SOA Design Patterns |publisher=Prentice Hall/PearsonPTR |location=New York |year=2009 |pages=864 |isbn=0-13-613516-1 |oclc= |doi=}}
* Frank Buschmann, [[Kevlin Henney]], [[Douglas C. Schmidt]] [http://media.wiley.com/product_data/excerpt/28/04700590/0470059028.pdf "On Patterns and Pattern Languages"]
* {{cite book
|title=[[Design Patterns (book)|Design Patterns (the '''Gang of Four''' book)]]
|author=Gamma, Helm, Johnson & Vlissides
|publisher=Addison-Wesley
|year=1994
|isbn=0-201-63361-2
|ref=Gang of Four
}} (Note: there is debate about whether the "Gang of Four" book actually contains any patterns in the Alexandrian's sense.)
* {{cite web
| accessdate = 2014-07-16
| author = James Coplien
| date = 2014-07-11
| title = Patterns: The Notion is Grounded in Alexander's Work
| quote = The GoF claims to take its pattern inspiration from Christopher Alexander (as they say in the front matter of the book), who popularized the term in the broader field of design. To Alexander a pattern: is always an element of pattern language; contributes to deep human feeling; and is always geometric in nature. At least some of the GoF patterns fail on at least one of these points, and several fail on all three.
| url = https://stackoverflow.com/questions/12981021/are-there-any-patterns-in-gof/24664544#24664544}}
* Jenifer Tidwell. ''Designing Interfaces''
* [[Wolfgang Pree]]. ''Design Patterns for Object-Oriented Software Development''
* Leitner, Helmut (2015). ''Pattern Theory: Introduction and Perspectives on the Tracks of Christopher Alexander'', {{ISBN|1505637430}}.

== External links ==
* Examples of [http://www.designpattern.co.il Design Patterns] in java
* [http://javadesign-patterns.blogspot.com/ Java Design Patterns] Full Tutorial
* [http://codingplayground.blogspot.it/2009/01/design-patterns-c-full-collection-of.html Full collection of design patterns (Creational, Structural, Behavioural) in C++] by Antonio Gulli
* [https://tcorral.github.io/Design-Patterns-in-Javascript/ Design Patterns in Javascript] by Tomás Corral


{{Design}}
{{Design}}


[[Category:Design patterns]]
[[Category:Design patterns| ]]


[[ja:デザインパターン]]
[[ja:デザインパターン]]

Latest revision as of 11:25, 6 November 2024

A design pattern is the re-usable form of a solution to a design problem. The idea was introduced by the architect Christopher Alexander[1] and has been adapted for various other disciplines, particularly software engineering.[2]

Details

[edit]

An organized collection of design patterns that relate to a particular field is called a pattern language. This language gives a common terminology for discussing the situations designers are faced with.

The elements of this language are entities called patterns. Each pattern describes a problem that occurs over and over again in our environment, and then describes the core of the solution to that problem, in such a way that you can use this solution a million times over, without ever doing it the same way twice.

— Christopher Alexander, A Pattern Language[1]

Documenting a pattern requires explaining why a particular situation causes problems, and how the components of the pattern relate to each other to give the solution.[3] Christopher Alexander describes common design problems as arising from "conflicting forces"—such as the conflict between wanting a room to be sunny and wanting it not to overheat on summer afternoons. A pattern would not tell the designer how many windows to put in the room; instead, it would propose a set of values to guide the designer toward a decision that is best for their particular application. Alexander, for example, suggests that enough windows should be included to direct light all around the room. He considers this a good solution because he believes it increases the enjoyment of the room by its occupants. Other authors might come to different conclusions, if they place higher value on heating costs, or material costs. These values, used by the pattern's author to determine which solution is "best", must also be documented within the pattern.

Pattern documentation should also explain when it is applicable. Since two houses may be very different from one another, a design pattern for houses must be broad enough to apply to both of them, but not so vague that it doesn't help the designer make decisions. The range of situations in which a pattern can be used is called its context. Some examples might be "all houses", "all two-story houses", or "all places where people spend time".

For instance, in Christopher Alexander's work, bus stops and waiting rooms in a surgery center are both within the context for the pattern "A PLACE TO WAIT".

Examples

[edit]

Business models also have design patterns.[4] See Business model § Examples.

See also

[edit]

References

[edit]
  1. ^ a b Alexander, Christopher (1977). A Pattern Language: Towns, Buildings, Construction. Center for Environmental Structure series. Vol. 2. New York: Oxford University Press. ISBN 0-19-501919-9. OCLC 3132495.
  2. ^ Gamma, Erich; Helm, Richard; Johnson, Ralph; Vlissides, John (1994). Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley professional computing series. Reading, Mass.: Addison-Wesley. ISBN 0-201-63361-2. OCLC 31171684. The "Gang of Four" book.
  3. ^ Maioriello, James (2002-10-02). "What are design patterns and do I need them?". developer.com. Retrieved 2011-03-21.
  4. ^ For example: Mettler, Tobias; Eurich, Markus (June 2012). "A 'design-pattern'–based approach for analyzing e-health business models". Health Policy and Technology. 1 (2): 77–85. doi:10.1016/j.hlpt.2012.04.005.

Further reading

[edit]