Weitere ähnliche Inhalte Ähnlich wie Intro to-patterns-linda-rising[1] (20) Mehr von YoungSu Son (20) Intro to-patterns-linda-rising[1]1. PLoP® Pattern Writing Bootcamp 2009
Chicago, IL
Robert Hanmer hanmer@alcatel-lucent.com
Linda Rising risingl@acm.org
August 27, 2009 - 1
PLoP is a registered Trademark of The Hillside Group.
Agenda
Introductions
Pattern Basics
Writers Workshops
Pattern Languages
Brainstorm architecture
Write patterns!
Workshop patterns
Summary, de-brief, plan next meeting
August 27, 2009 - 2
Copyright © 2007-2009. Alcatel-Lucent.
1
2. Part 1: Pattern Basics
August 27, 2009 - 3
Patterns
• “The pattern is, in short, at the same time a thing, which
happens in the world, and the rule which tells us how to create
that thing, and when we must create it. It is both a process and
a thing; both a description of a thing which is alive, and a
description of the process which will generate that thing.”
-- Christopher Alexander,
The Timeless Way of Building
August 27, 2009 - 4
Copyright © 2007-2009. Alcatel-Lucent.
2
3. Christopher Alexander
• Building architect and theorist
• Many books on architecture and art:
A Pattern Language
The Timeless Way of Building
The Oregon Experiment
The Production of Houses
A Foreshadowing of 21st Century Art -- The Color and
Geometry of Very Early Turkish Carpets
The Nature of Order (4 volumes)
• http://www.livingneighborhoods.org
August 27, 2009 - 5
The Quality Without A ame
• “There is a central quality which is the root criterion of life and
spirit in a man, a town, a building, or a wilderness. This
quality is objective and precise, but it cannot be named.”
– Alexander, The Timeless Way of Building
• (“but with an acronym” -- Joe Davison)
August 27, 2009 - 6
Copyright © 2007-2009. Alcatel-Lucent.
3
4. What is a Pattern?
• Rule of 3
• More than an algorithm
• “At the same time, a thing that happens in the world … and the
rules to make that thing …”
August 27, 2009 - 7
Patterns Will ot:
• … make you an instant expert
• … provide a “turn the crank” approach to software
• … eliminate the need for intelligence and taste
• … make you rich and famous
– unless you become a snake oil salesman
• … generate code
• Paul S. R. Chisholm, AT&T 10/94
August 27, 2009 - 8
Copyright © 2007-2009. Alcatel-Lucent.
4
5. Part 2: A Pattern’s Parts
August 27, 2009 - 9
Parts of a Pattern
• Name
• Context
• Statement of the Problem
• Forces
• Resolution/Solution
• Sketch
• Resulting Context
• Authorship information
• (and some optional parts)
August 27, 2009 - 10
Copyright © 2007-2009. Alcatel-Lucent.
5
6. Context
• Where does the problem exist?
• What are the relevant preconditions?
• What are the patterns that this pattern helps resolve?
• Who is the target audience?
• What are the constraints on the system that you cannot change
or control?
– Language choice
– Memory space
– etc.
August 27, 2009 - 11
Statement of the Problem
• What is the problem being solved?
• What’s wrong in the current environment?
August 27, 2009 - 12
Copyright © 2007-2009. Alcatel-Lucent.
6
7. Forces
• What makes this a hard problem?
• What are the tradeoffs?
• Why aren’t the obvious solutions sufficient?
• What are the constraints upon the system over which you have
some control?
August 27, 2009 - 13
Resolution/Solution
• Succinctly state the action that the reader should take to resolve
the problem
• Build upon the forces and customize
• Be specific
• Ensure that the resolution resolves the stated problem – try
reading them out loud, one after the other
August 27, 2009 - 14
Copyright © 2007-2009. Alcatel-Lucent.
7
8. Sketch
• “If you can’t draw a diagram of it, it isn’t a pattern.”
– Alexander, TTWOB, p 267.
• Sketch What?
– Whatever will help convey the ideas to the reader.
• UML diagrams
• Block diagram
• Image of a concrete example
• etc.
August 27, 2009 - 15
Resulting Context
• What does the environment look like after the
resolution/solution has been applied?
• What new problems have been introduced?
• What patterns will resolve the new problems?
• This is a good place for war stories and anecdotes
August 27, 2009 - 16
Copyright © 2007-2009. Alcatel-Lucent.
8
9. Author
• Intellectual Currency
– Ideas are worth more if given away.
– We want to be able to give credit where credit is due
• Identify the author
• Identify the revision history
– Patterns evolve
• As our understanding grows
• As they are workshoped and improved by reader feedback
• Acknowledgements for shepherds, members of writers’
workshops and others that helped you shape the pattern
August 27, 2009 - 17
ame
• Choose with care – initially make a list of AKAs
• Many views on what form the title should take
– Noun Phrase- Corporate Sponsor, Model View Controller
– Verb Phrase- Do Food, Shift to Multiply
– Catchy Phrase- George Washington is still Dead
• It will be part of a vocabulary or language
• Choose with care
August 27, 2009 - 18
Copyright © 2007-2009. Alcatel-Lucent.
9
10. Other Sections
• Rationale
• Sample Code
• Related Patterns
• Known Implementations
• References
August 27, 2009 - 19
Part 3: Writers Workshops
August 27, 2009 - 20
Copyright © 2007-2009. Alcatel-Lucent.
10
11. Writers’ Workshops
• Structured discussion of the merits and suggestions for
improvement
• “Criticism” is not welcome -- only suggestions for
improvement.
– “I suggest the author add a reference to the paper by Beck and Auer in
the Context as it will help establish how their works complement each
other.”
• Praise is always welcome
– What people like about a pattern is very important.
• Author is present for note taking but does not participate except
at very specific times.
• Strong moderation.
August 27, 2009 - 21
Writers’ Workshops
• Jim Coplien has published a pattern language for Writers’
Workshops.
– PLOPD4, chapter 25
– http://users.rcn.com/jcoplien/Patterns/WritersWorkshop/
– He (and co-author/shepherd Bobby Woolf) delve into the reasons
behind way that Writers’ Workshops are structured.
August 27, 2009 - 22
Copyright © 2007-2009. Alcatel-Lucent.
11
12. Writers’ Workshops
• Moderator introduces pattern and the author(s)/editor(s)
• The author stands and reads a short (1-4 sentence) excerpt of the paper
• The author becomes a “fly on the wall”
– Avoid eye contact with the author
– The author is referred to as “the author”, NOT by name
• A participant summarizes the pattern
• Discuss the positive aspects of the paper
– What should be kept in the next revision
– What the readers found especially appealing
• Offer suggestions for improvement.
• Welcome the author back
– Author thanks the group
– This is not an opportunity to debate or explain the pattern
– Author may only ask clarifying questions
• Everyone (except author) stands and thank the author for the opportunity to
workshop the work.
• Take a different seat and tell an unrelated story.
August 27, 2009 - 23
Part 4: Pattern Languages
August 27, 2009 - 24
Copyright © 2007-2009. Alcatel-Lucent.
12
13. Pattern Languages
• Individual patterns are useful, but . . .
• they are most powerful when combined into a language
• “Each pattern then, depends both on the smaller patterns it
contains, and on the larger patterns within which it is
contained.”
Alexander, TTWOB, p 312.
August 27, 2009 - 25
Pattern Languages
• Individual Patterns are good
– No individual pattern balances all the tradeoffs.
• To address real sized problems, languages are really essential
• A language is a collection of patterns that work together.
• Within a pattern language the patterns build upon each other,
resolving unbalanced forces from previous patterns.
August 27, 2009 - 26
Copyright © 2007-2009. Alcatel-Lucent.
13
14. Pattern Languages (cont.)
• Pattern languages must be complete in two ways
– Morphologically
• Patterns fit together to form a complete structure without gaps.
– Functionally
• Any new forces introduced by the patterns are resolved by the patterns
themselves.
• If they are not complete in these ways we refer to them as a
“collection”
– The GOF and POSA books are collections
August 27, 2009 - 27
Example Pattern Languages:
• Alexander’s Garden
– The only known pattern language diagram from Alexander
From The Timeless Way of Building
August 27, 2009 - 28
Copyright © 2007-2009. Alcatel-Lucent.
14
15. Another Example
• Telecommunications I/O
From PLOPD4
August 27, 2009 - 29
Selected Bibliography
A Pattern Language. Alexander et. Al. New York: Oxford University Press, 1977.
Design Patterns - Elements of Reusable Object-Oriented Software. Gamma, Helm,
Johnson and Vlissides (The “Gang of Four”). Reading, MA: Addison-Wesley,
1995.
Pattern Oriented Software Architecture. Buschmann, Meunier, Rohnert, Sommerlad and
Stal. Chichester, UK: Wiley & Sons, 1996.
Pattern Oriented Software Architecture, Vol. 2. Schmidt, Stal, Rohnert, Buschmann.
Chichester, UK: Wiley & Sons, 2000.
PLOPD – PLOPD5: Pattern Languages of Program Design, volumes 1-5. Various
editors. Reading, MA: Addison-Wesley, 1995-2006.
The Pattern Handbook. Rising, ed. Cambridge: Cambridge University Press, 1998.
PLoP Conference Proceedings: http://hillside.net/plop/
The Pattern Almanac 2000. Rising. Reading, MA: Addison-Wesley, 2000.
Fearless Change. Manns and Rising. Reading, MA: Addison-Wesley, 2004.
The Timeless Way of Building. Alexander. New York: Oxford University Press, 1979.
For more books: http://hillside.net/patterns/books/index.htm
August 27, 2009 - 30
Copyright © 2007-2009. Alcatel-Lucent.
15