Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Software design pattern
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==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.<ref name = "GabrielHillside">{{cite web | first = Dick | last = Gabriel | author-link = Richard P. Gabriel | title = A Pattern Definition | url = http://hillside.net/patterns/definition.html | access-date = 2007-03-06 |archive-url = https://web.archive.org/web/20070209224120/http://hillside.net/patterns/definition.html <!-- Bot retrieved archive --> | archive-date = 2007-02-09}}</ref> 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 (software engineer)|Martin Fowler]], certain pattern forms have become more well-known than others, and consequently become common starting points for new pattern-writing efforts.<ref name = "Fowler2006">{{cite web | first = Martin | last = Fowler | author-link = Martin Fowler (software engineer) | title = Writing Software Patterns | url = http://www.martinfowler.com/articles/writingPatterns.html | date = 2006-08-01 | access-date = 2007-03-06 }}</ref> One example of a commonly used documentation format is the one used by [[Erich Gamma]], [[Richard Helm]], [[Ralph Johnson (computer scientist)|Ralph Johnson]], and [[John Vlissides]] in their book ''[[Design Patterns]]''. It contains the following sections: *'''Pattern Name and Classification:''' 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 (Forces):''' 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. [[Unified Modeling Language#UML Class Diagram|Class diagram]]s and [[Interaction diagram]]s 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.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)