Patterns
From WhyNotWiki
Contents |
[edit] What patterns are
What is a pattern? (http://www.wikipatterns.com/pages/viewpage.action?pageId=65805).
The concept of a pattern was introduced by the architect Christopher Alexander in his book The Timeless Way of Building. Alexander described a pattern as "a three part rule, which expresses a relation between a certain context, a problem, and a solution".Patterns recognise techniques and constructs that practitioners of a craft have come across repeatedly, and presents them in a particular format or "pattern language", which describes in what context these techniques arise, what problem they solve, and how they solve them.
A pattern is a model considered worthy of imitation (i.e., if it worked for others, it can work for you). Newcomers can benefit from their predecessors' experiences so they don't have to make the same mistakes fumbling around for the same solutions to the same problems. Just as importantly, patterns give adepts a shared language in which to speak about these common concepts.
For example, anyone who has used a wiki for some time knows that it's good to have people around who will fix up typos and broken links, and make sure pages are in their correct categories. A pattern makes it easier to talk about these people because it gives them a name (WikiGardener), and also explains that the best way to encourage WikiGardeners is to have a wiki where everyone is comfortable editing pages, and there is no rigid ownership of content.
[edit] Pattern Languages
One of the most important parts of any catalogue of patterns is the pattern language. This is the template to which all patterns should be written, ensuring that for each pattern, all of Alexander's "three part rule" is properly covered.
For information on the pattern language we use for wikipatterns, read The WikiPatterns Pattern Language.
[edit] Antipatterns
Antipatterns are patterns that represent a negative behaviour or consequence. They describe situations that you'd rather didn't occur, but that are common nonetheless.
The most important part of an Antipattern is the refactored solution, which answers the question: "If we find ourselves in this situation, how best can we extricate ourselves from it and get back on track?"
See also, The WikiPatterns Antipattern Language.
[edit] Notes
Patterns are great. I wonder why people don't (and wish that they would) write patterns instead of just tutorials or demos...
Don't just show me how you did it; show me how to generalize it to any case (but especially to my needs)!
I guess tutorials are probably closer to patterns than demos. (But both are useful.)
This is sort of like the call that I read someone (DHH?) make, saying we need more people to write up tutorials about how to do stuff in Rails, about how it's not so much about making a framework that does everything for you; how there is still a need for "patterns" (not the word they used, but seems applicable) for different ways you can use the framework...
