e01.org

Software design pattern

A software design pattern describes a reusable solution to a commonly needed behavior in software. A design pattern is not a rigid structure to be copied directly into source code. Rather, it is a description of and a template for solving a particular type of problem that can be used in many different contexts, including different programming languages and computing platforms. Design patterns can be viewed as formalized best practices that the programmer may use to solve common problems when designing software. Object-oriented design patterns typically show relationships and interactions between classes or objects, without specifying the final application classes or objects that are involved. Patterns that imply mutable state may be unsuited for functional programming languages. Some patterns can be rendered unnecessary in languages that have built-in support for solving the problem they are trying to solve, and object-oriented patterns are not necessarily suitable for...

A software design pattern describes a reusable solution to a commonly needed behavior in software. A design pattern is not a rigid structure to be copied directly into source code. Rather, it is a description of and a template for solving a particular type of problem that can be used in many different contexts, including different programming languages and computing platforms. Design patterns can be viewed as formalized best practices that the programmer may use to solve common problems when designing software. Object-oriented design patterns typically show relationships and interactions between classes or objects, without specifying the final application classes or objects that are involved. Patterns that imply mutable state may be unsuited for functional programming languages. Some patterns can be rendered unnecessary in languages that have built-in support for solving the problem they are trying to solve, and object-oriented patterns are not necessarily suitable for non-object-oriented languages. ==History== Patterns originated as an architectural concept by Christopher Alexander as early as 1977 in A Pattern Language (cf. his article, "The Pattern of Streets," JOURNAL OF THE AIP, September, 1966, Vol. 32, No. 5, pp. 273–278). In 1987, Kent Beck and Ward Cunningham began experimenting with the idea of applying patterns to programming – specifically pattern languages – and presented their results at the OOPSLA conference that year. In the following years, Beck, Cunningham and others followed up on this work. Design patterns gained popularity in computer science after the book Design Patterns: Elements of Reusable Object-Oriented Software was published in 1994 by the so-called "Gang of Four" (Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides), which is frequently abbreviated as "GoF". That same year, the first Pattern Languages of Programming Conference was held, and the following year the Portland Pattern Repository was set up for documentation of design patterns. Although design patterns have been applied practically for a long time, formalization of the concept of design patterns languished for several years. ==Motif== A pattern describes a design motif, also known as a prototypical micro-architecture, as a set of program constituents (e.g., classes, methods...) and their relationships. A developer adapts the motif to their codebase to solve the problem described by the pattern. The resulting code has structure and organization similar to the chosen motif. ==Domain-specific patterns== Efforts have also been made to codify design patterns in particular domains, including the use of existing design patterns as well as domain-specific design patterns. Examples include user interface design patterns, information visualization, secure design, "secure usability", web design and business model design. The annual Pattern Languages of Programming Conference proceedings include many examples of domain-specific patterns. ==Examples== Design patterns can be organized into groups based on what kind of problem they solve. ==Documentation== The documentation for a design pattern describes the context in which the pattern is used, the forces within the context that the pattern seeks to resolve, and the suggested solution. There is no single, standard format for documenting design patterns. Rather, a variety of different formats have been used by different pattern authors. However, according to Martin Fowler, certain pattern forms have become more well-known than others, and consequently become common starting points for new pattern-writing efforts. One example of a commonly used documentation format is the one used by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides in their book Design Patterns. It contains the following sections: Name: A descriptive and unique name that helps in identifying and referring to the pattern. Intent: A description of the goal behind the pattern and the reason for using it. Also Known As: Other names for the pattern. Motivation: A scenario consisting of a problem and a context in which this pattern can be used. Applicability: Situations in which this pattern is usable; the context for the pattern. Structure: A graphical representation of the pattern. Class diagrams and Interaction diagrams may be used for this purpose. Participants: A listing of the classes and objects used in the pattern and their roles in the design. Collaboration: A description of how classes and objects used in the pattern interact with each other. Consequences: A description of the results, side effects, and trade offs caused by using the pattern. Implementation: A description of an implementation of the pattern; the solution part of the pattern. Sample Code: An illustration of how the pattern can be used in a programming language. Known Uses: Examples of real usages of the pattern. Related Patterns: Other patterns that have some relationship with the pattern; discussion of the differences between the pattern and similar patterns. ==Criticism== Some suggest that the need for a design pattern may be a sign that a feature is missing from a programming language. Peter Norvig 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. Related observations were made by who implemented several of the 23 design patterns using an aspect-oriented programming language (AspectJ) and showed that code-level dependencies were removed from the implementations of 17 of the 23 design patterns and that aspect-oriented programming could simplify the implementations of design patterns. See also Paul Graham's essay "Revenge of the Nerds". Inappropriate use of patterns may unnecessarily increase complexity. By definition, a pattern must be programmed anew into each application that uses it. Since some authors see this as a step backward from software reuse as provided by components, researchers have worked to use generic programming facilities to turn patterns into components, in a process called componentization. were able to provide full or partial componentization of two-thirds of the patterns they attempted. In order to achieve flexibility, design patterns may introduce additional levels of indirection, which may complicate the resulting design and decrease runtime performance. ==See also== Abstraction principle Algorithmic skeleton Anti-pattern Architectural pattern Canonical protocol pattern Debugging patterns Design pattern Distributed design patterns Enterprise architecture framework GRASP (object-oriented design) Helper class Interaction design pattern List of software architecture styles and patterns List of software development philosophies List of software engineering topics Pattern language Pattern theory Pedagogical patterns Portland Pattern Repository Programming idiom Refactoring Software development methodology ==References== ===Citations=== ===Bibliography=== ==Further reading==

References

  1. ^ Alexandrescu, Andrei (2001). Modern C++ Design: Generic Programming and Design Patterns Applied . Addison–Wesley. p. xviii. ISBN 978-0-201-70431-0 . Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  2. ^ Laakso, Sari A. (2003-09-16). "Collection of User Interface Design Patterns" . University of Helsinki, Dept. of Computer Science . Retrieved 2008-01-31 . Wikipedia revision 1374508132, retrieved 2026-11-21 · 1201734000.0
  3. ^ Heer, J.; Agrawala, M. (2006). "Software Design Patterns for Information Visualization" . IEEE Transactions on Visualization and Computer Graphics . 12 (5): 853– 60. doi : 10.1109/TVCG.2006.178 . PMID 17080809 . S2CID 11634997 . Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  4. ^ Dougherty, C.; Sayre, K.; Seacord, R. C.; Svoboda, D.; Togashi, K. (2009). Secure Design Patterns . Software Engineering Institute, CMU . doi : 10.1184/R1/6583640.v1 . Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  5. ^ Garfinkel, Simson L. (2005). Design Principles and Patterns for Computer Systems That Are Simultaneously Secure and Usable (Ph.D. thesis). MIT . hdl : 1721.1/33204 . Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  6. ^ Díaz, P.; Rosson, M. B.; Aedo, I.; Carroll, J. M. (March 2009). "Web Design Patterns: Investigating User Goals and Browsing Strategies". In Pipek, V.; Rosson, M. B.; de Ruyter, B.; Wulf, V. (eds.). End-User Development . 2nd International Symposium on End User Development. Lecture Notes in Computer Science . Vol. 5435. Heidelberg: Springer Berlin . pp. 186– 204. doi : 10.1007/978-3-642-00427-8_11 . ISBN 978-3-642-00427-8 . Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  7. ^ Amshoff, B.; Dülme, C.; Echterfeld, J.; Gausemeier, J. (2015). "Business model patterns for disruptive technologies". International Journal of Innovation Management . 19 (03). Imperial College Press : 1540002. doi : 10.1142/S1363919615400022 . ISSN 1757-5877 . Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  8. ^ Pattern Languages of Programming, Conference proceedings (annual, 1994—) [1] Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  9. ^ Horner, Mark (2005). "Patterns" . Pro .NET 2.0 Code and Design Standards in C# . Apress. pp. 171– 181. ISBN 978-1-59059-560-2 . Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  10. ^ Mössenböck, Hanspeter (July 1999). "Twin – A Design Pattern for Modeling Multiple Inheritance" (PDF) . Proceedings of the Third International Andrei Ershov Memorial Conference on Perspectives of System Informatics . PSI '99. Novosibirsk, Russia: Springer–Verlag . pp. 358– 369. ISBN 978-3-540-67102-2 . Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  11. ^ Binding Properties Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  12. ^ Nagel, C.; Evjen, B.; Glynn, J.; Watson, K.; Skinner, M. (2008). "Event-based Asynchronous Pattern". Professional C# 2008 . Wiley. pp. 570– 571. ISBN 978-0-470-19137-8 . Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  13. ^ Francalanza, Adrian; Tabone, Gerard (October 2023). "ElixirST: A session-based type system for Elixir modules" . Journal of Logical and Algebraic Methods in Programming . 135 . doi : 10.1016/j.jlamp.2023.100891 . S2CID 251442539 . Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  14. ^ Cecilia, Jean (10 June 2026). "The Ontological Shift of Software Architecture: Design Pattern Relevance in Modern Programming Languages" . Retrieved 10 June 2026 . Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  15. ^ Schmidt, Douglas C.; Vinoski, Steve (July–August 1996). "Object Interconnections: Comparing Alternative Programming Techniques for Multi-threaded CORBA Servers (Column 7)" (PDF) . SIGS C++ Report . S2CID 2654843 . Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  16. ^ Arnout, Karine Marguerite Alice (2004). From patterns to components (Doctoral thesis). Switzerland: ETH Zurich . doi : 10.3929/ethz-a-004715194 . hdl : 20.500.11850/72828 . Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  17. ^ Oliveira, B. C. d. S.; Wang, M.; Gibbons, J. (19 October 2008). "The visitor pattern as a reusable, generic, type-safe component" . ACM SIGPLAN Notices . 43 (10). Association for Computing Machinery : 439– 456. doi : 10.1145/1449955.1449799 . eISSN 1558-1160 . Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  18. ^ Meyer, Bertrand ; Arnout, Karine (July 2006). "Componentization: The Visitor Example" (PDF) . Computer . 39 (7). IEEE : 23– 30. doi : 10.1109/MC.2006.227 . S2CID 15328522 . Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  19. ^ Babar, Muhammad Ali; Kitchenham, Barbara; Maheshwari, Piyush (2006). "Assessing the value of Architectural Information Extracted from Patterns for Architecting" . 10th International Conference on Evaluation and Assessment in Software Engineering (EASE) . doi : 10.14236/ewic/ease2006.6 . ISSN 1477-9358 . Retrieved 2026-05-06 . Wikipedia revision 1374508132, retrieved 2026-11-21 · 1778022000.0
  20. ^ Bishop, Judith (December 2007). C# 3.0 Design Patterns . O'Reilly Media. ISBN 978-0-596-52773-0 . Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  21. ^ Tiako, Pierre F. (31 March 2009). "Formal Modeling and Specification of Design Patterns Using RTPA" . In Tiako, Pierre F (ed.). Software Applications: Concepts, Methodologies, Tools, and Applications: Concepts, Methodologies, Tools, and Applications . p. 636. doi : 10.4018/978-1-60566-060-8 . ISBN 978-1-60566-061-5 . Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  22. ^ Baroni, A. L.; Guéhéneuc, Y. G.; Albin-Amiot, H. (June 2003). Design Patterns Formalization (Report). EMN Technical Report. Nantes : École Nationale Supérieure des Techniques Industrielles et des Mines de Nantes. S2CID 624834 . Academia 2859481 . ResearchGate 277282980 . Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  23. ^ Beck, Kent ; Cunningham, Ward (September 1987). Using Pattern Languages for Object-Oriented Program . OOPSLA '87 workshop on Specification and Design for Object-Oriented Programming . Retrieved 2006-05-26 . Wikipedia revision 1374508132, retrieved 2026-11-21 · 1148598000.0
  24. ^ Bloch, Joshua (2008). "Item 37: Use marker interfaces to define types" . Effective Java (Second ed.). Addison–Wesley. p. 179 . ISBN 978-0-321-35668-0 . Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  25. ^ Alur, Crupi & Malks (2003) , p. 166. Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  26. ^ Beck (2007) , ch. 5. Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  27. ^ Beck et al. (1996) , pp. 104, 106. Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  28. ^ Beck et al. (1996) , p. 109. Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  29. ^ a b c d e Fowler (2002) . Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  30. ^ Fowler (2002) , p. 344. Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  31. ^ a b c Gamma et al. (1995) . Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  32. ^ Gamma et al. (1995) , p. 3. Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  33. ^ Iglberger (2022) , p. 404. Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  34. ^ Iglberger (2022) , pp. 5–8. Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  35. ^ a b Iglberger (2022) , p. 8. Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  36. ^ a b c McConnell (2004) , pp. 104–105. Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  37. ^ McConnell (2004) , p. 105. Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  38. ^ a b c Richards & Ford (2020) . Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  39. ^ a b c Zheng & Harper (2010) , p. 42. Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  40. ^ Fowler, Martin (2006-08-01). "Writing Software Patterns" . Retrieved 2007-03-06 . Wikipedia revision 1374508132, retrieved 2026-11-21 · 1173135600.0
  41. ^ Gabriel, Dick . "A Pattern Definition" . Archived from the original on 2007-02-09 . Retrieved 2007-03-06 . Wikipedia revision 1374508132, retrieved 2026-11-21 · 1173135600.0
  42. ^ Graham, Paul (2002). "Revenge of the Nerds" . Retrieved 2012-08-11 . Wikipedia revision 1374508132, retrieved 2026-11-21 · 1344639600.0
  43. ^ Hannemann, Jan; Kiczales, Gregor (2002). "Design pattern implementation in Java and AspectJ". Proceedings of the 17th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications . OOPSLA '02. pp. 161– 173. doi : 10.1145/582419.582436 . ISBN 1-58113-471-1 . Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  44. ^ Norvig, Peter (1998). Design Patterns in Dynamic Languages . Object World. Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  45. ^ Schmidt, Douglas C.; Stal, Michael; Rohnert, Hans; Buschmann, Frank (2000). Pattern-Oriented Software Architecture, Volume 2: Patterns for Concurrent and Networked Objects . John Wiley & Sons. ISBN 978-0-471-60695-6 . Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  46. ^ Smith, Reid (1987). "Panel on design methodology: OOPSLA '87 Panel Session" . ACM SIGPLAN Notices . 23 (5). Association for Computing Machinery . doi : 10.1145/62138.62151 . 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. Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  47. ^ a b Gabrijelčič, Primož (27 February 2019). "Introduction to patterns". Hands-On Design Patterns with Delphi . Packt Publishing. pp. 9– 35. ISBN 978-1-78934-324-3 . Wikipedia revision 1374508132, retrieved 2026-11-21 · 1795215600.0
  48. Wikipedia “Software design pattern” revision 1374508132 · retrieved 2026-10-20 publication date (×1) · confidence 0.95 revision URL · 1792450800.0
source: e01 Encyclopedia · licence: CC BY-SA 4.0 · page · source revision

Cite this

"Software design pattern". 1789215157. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1374508132

JSON record · API collection · citation policy