Template:Pattern/doc
From WikiEducator
A generic Pattern template based on the scheme in the book Core J2EE Patterns by Alur et al. See for example pp 129-130 in the 2nd edition for a description of a pattern template (which is in turn based on the work of Gamma et al (1995)[1] inspired by the work of Christopher Alexander[2]).
Contents
Usage
The following:
{{Pattern |theme=sandy |name=Celebrate Diversity |context=Globalisation, migration, potential for cultural conflict, ... |problem=Tendency to be suspicious of people who are different, mistrust, ... |forces=Resistance to change |solution=Celebrate diversity ... |consequences=If everyone did this, people would feel free to be who they are, accept their differences and get along ... |case=Examples of countries (or cities etc.) with diversity ... |related=Contemplate |}}
produces:
Celebrate Diversity | |
---|---|
Context: | Globalisation, migration, potential for cultural conflict, ... |
Problem: | Tendency to be suspicious of people who are different, mistrust, ... |
Forces: | Resistance to change |
Solution: | Celebrate diversity ... |
Consequences: | If everyone did this, people would feel free to be who they are, accept their differences and get along ... |
Case: | Examples of countries (or cities etc.) with diversity ... |
Related: | Contemplate |
Parameters
The template reflects a variation on the "Alexandrian form" but with explicit place holders for each of the following:
- theme - a colour scheme for the pattern indicated with a theme name (see 'Themes' below)
- name - a descriptive name for the pattern; choose a name which is as self-explanatory as possible
- context - describe the context for the pattern indicating when and why it is relevant
- problem - indicate what specific problem(s) the pattern addresses
- forces - indicate what forces are in play, and how the pattern balances these forces
- solution - structure of the design pattern of architecture, code, thought, behaviour or action (etc.) and strategies for applying it to solve the problem(s)
- consequences - describe the benefits and trade-offs (pros and cons) of applying this pattern and strategies in context
- case - describe one or more situations where such a pattern/strategy was applied successfully
- related - links to related patterns (internal and external) with a brief explanation of the relationship.
Themes
The theme parameter is the name of a theme defined in template {{Box Theme Attribute}}. Available themes are illustrated here.
To create a new theme edit template {{Box Theme Attribute}}.
To Do
- Make the template include a separately editable page named <pattern title> as a parameter (naming problems and losing pages?)
- Then we can have a decorator template with project management features (color coded status fields, icons, categories, authors, etc.).
- Make a generator: AddBeLibrePattern
- BeLibrePattern: name space?
References
- ↑ Gamma, Erich; Richard Helm, Ralph Johnson, and John Vlissides (1995). Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley. ISBN 0-201-63361-2.
- ↑ Alexander, Christopher; Sara Ishikawa, Murray Silverstein, Max Jacobson, Ingrid Fiksdahl-King, Shlomo Angel (1977). A Pattern Language: Towns, Buildings, Construction. New York: Oxford University Press. ISBN 978-0195019193