Contenu connexe Similaire à Hanmer Software Patterns Bosc2009 Similaire à Hanmer Software Patterns Bosc2009 (20) Hanmer Software Patterns Bosc20092. About me
MSCS, Northwestern University, 1987.
Working at Northwestern University Med School & computer center
benefited from shared software
While on AT&T 4ESS™ Switch project– learned about reusing design ideas and the
importance of architectural integrity
In Bell Labs – shared my knowledge with projects
Now in Alcatel-Lucent Operations – making sure we only use good 3rd party and free
software (FOSS)
Member of Alcatel-Lucent Technical Academy
Senior member of ACM
Writing patterns since 1994
President of Hillside Group
Author of Patterns for Fault Tolerant Software
2 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
3. Agenda
1. Design, Reusable & Software Patterns
2. What is a Software Pattern?
3. Pattern Communities
4. Using Patterns
5. Writing and Collecting Patterns
6. Pattern Research
7. Patterns within your community
8. Wrapup
4. Design,
Reusable
& Software Patterns
5. Design
As a noun:
5 a: an underlying scheme that governs functioning, developing, or unfolding …
b: a plan or protocol for carrying out or accomplishing something (as a
scientific experiment) ; also : the process of preparing this
As a verb:
1: to conceive or execute a plan
2: to draw, lay out, or prepare a design
-- www.meriam-webster.com
5 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
6. Reusable
Adjective: capable of being used again or repeatedly
-- www.merriam-webster.com
Some adjectives that apply to things that are reusable:
flexible
Modular
understandable
-- Other fields have handbooks to capture their reusable information.
6 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
7. Reusable Design
Design and design elements that are
Modular
Flexible
Usable more than once
Can be communicated
Grady Booch: “Software development has been, is, and will likely remain
fundamentally hard.”
7 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
8. Software 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
A software pattern is a description of modular proven solution to a design
problem with enough information so that the reader can flexibly adapt it to their
unique situations.
8 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
9. 9 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
10. What is a Software Pattern?
10 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
11. Pattern: Leaky Bucket Counters
Context: A system that is intended to recognize and correct problems
automatically. In this environment the system needs to know if a problem is
something that comes and goes intermittently , or only happens once, i.e. is
"transient" or is a repeating “permanent” fault that needs to be corrected. Signal
crosstalk, static electric discharges, lightning strikes or intermittently broken
keys on a keyboard cause transient errors, which should be treated differently
than permanent faults.
Problem: How can you know if a fault is transient?
Forces: You want a module to exhibit a permanent error before taking drastic
action. The component that reports the error might be an innocent victim. It
shouldn’t be punished.
In many cases you are willing to allow a certain number of errors if they aren’t
too close together. If they come too close together you want the system to
trigger some sort of error processing action.
11 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
12. Leaky Bucket Counters (2)
Solution: Each failure group that is to be watched has a counter
(the leaky bucket counter) which is initialized to a
predetermined value when the system is first initialized. The
counter is incremented for each error or fault detected. The
counter is decremented on a periodic timed basis, but will
never be decremented beyond its initial value.
A counter incrementing past a pre-determined threshold
value indicates that the rate of error or fault events exceeds
the allowable rate (as defined by the empty or leak rate, rate
of errors and threshold value). This should be taken as an
indication that the fault is not transient.
12 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
13. Leaky Bucket Counters (3)
Resulting Context: A system in which errors are isolated and handled (by taking
devices out of service), but transient errors don't cause unnecessary loss of
service.
Author: Robert Hanmer, incorporating several versions by Robert Gamoke, James
Coplien and Gerard Meszaros. A revised version in a different format is in
Patterns for Fault Tolerant Software.
13 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
14. What is a Pattern?
A proven solution
Rule of 3
More than an algorithm
A pattern explains the context when its applicable
A pattern explains the trade-offs and alternatives
“At the same time, a thing that happens in the world … and the rules to make
that thing …”
14 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
15. Patterns Are:
A resolution of forces
A form of architectural and design documentation
Relationships that cuts across system parts
“Solution to a Problem in a Context”
A way of explaining non-traditional solutions
A family of solutions that abstractly address related problems in a specific
context
A literary form
15 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
16. Patterns are useful for:
Learning from what has worked in the past
Not re-inventing the wheel
Not repeating past errors
Providing a vocabulary for architects/designers
Passing on architectural knowledge
Providing a window into the minds of the experts
Transferring proven solutions from one industry segment to another
To structure OO code
16 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
17. Patterns Will Not:
… 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
17 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
18. Depth of Patterns
Some patterns are at a very low-level:
An example solution: Use a shift to multiple or divide by a power of 2
Some are very general:
For example: Model View Controller
18 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
19. The Quality Without A Name
“There is a central quality which is the root criterion of life and spirit in a man, a
town, a building, or a wilderness [or software]. This quality is objective and
precise, but it cannot be named.”
– Alexander, The Timeless Way of Building
Who was Christopher Alexander?
Building architect and theorist, Professor at UC Berkeley www.patternlanguage.com
Many books on architecture and art:
Patterns: A Pattern Language, The Timeless Way of Building, The Oregon Experiment, The
Production of Houses
Art: A Foreshadowing of 21st Century Art -- The Color and Geometry of Very Early Turkish
Carpets
Beyond patterns: The Nature of Order
19 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
20. Patterns Handbook
Patterns build the handbook of software design and construction
Patterns available in reference book easily accessible to designers
No need to memorize all the details -- the reference book is available
20 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
21. The Pattern Almanac
Published 3/2000
Summarizes all the published,
widely available patterns
Indices based upon pattern
intent
Planned to be updated regularly
and to be available on the internet
21 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
22. What is a Pattern Language?
A collection of patterns that work together
A collection of patterns that build upon each other to build something bigger
than any of the individual patterns can build
“All acts of building are governed by a pattern language of some sort.”
– TTWOB, p 193
22 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
23. An Example Pattern Language
Telecom IO
A specialized set of patterns for defining the human-machine interface has
come into use with the world of embedded telecommunications products.
These patterns provide an essential interface between a system and its human
masters.
23 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
24. Telecom IO Pattern Intents
Alarm Grid Group alarms into grids to help the workers identify problems.
Audible Alarms Sound audible alarms to alert office personnel of problems.
Beltline Terminal Allow workers to take their terminals with them.
Don't Let Them Forget Reassert alarms when necessary, purposely forgetting requests to retire the
alarms.
Five Minutes of No Escalation Don't confuse craft with too frequent messages.
Messages
George Washington is Still Dead Issue state change messages only when the state changes, not to remind about
the current state.
IO Gatekeeper Put one process in charge of IO for the system.
IO Triage Add a priority tag to each output message and sort the output using them.
Mind Your Own Business Only send output to concerned terminal groups (logical channels).
MML Use a standardized IO language.
Office Alarms Allow the alarm system to be customizable with site specific alarms.
Pseudo-IO Provide for internal subsystems to add IO to the stream.
Raw I/O Provide a way for recovery systems to bypass the IO Gatekeeper.
Shut Up And Listen Give human input/output messages a high priority.
String A Wire Provide a system to system emergency information channel.
The Bottom Line Issue messages to summarize a number of events rather than for each of
many events.
Timestamp Add a timestamp and/or a sequence number to each output message.
Who Asked? for Reusable Design | June 2009
24 | Software Patterns Return output only toAlcatel-Lucent 2009channel/terminal that requested it.
All Rights Reserved © the logical
25. Telecom IO
PLoPD-4
25 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
26. What is a Software Pattern?
A description of a reusable proven design element
with enough information to recreate the design, customized for the situation
An element of a pattern language
A collection of patterns that work together to solve larger problems
The building block for a software handbook
26 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
27. Pattern Communities
27 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
28. Pattern Communities
The Hillside Group
A worldwide organization to make the life of people touching software better
and to sponsor pattern conferences. Hillside.net
Hillside Europe
A European group centered around Germany that sponsors conferences and SE
Radio. hillside.net/europlop/HillsideEurope, se-radio.net
HCI pattern community
www.hcipatterns.org – Jan Borchers
www.welie.com – Martijn van Welie
28 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
29. Patterns Community
Pattern movement origins
1989-1992
Advanced C++ Programming Styles & Idioms by James Coplien
OOPSLA
Hillside Group
Pattern Conferences
PLoP
hillside.net/plop
EuroPLoP
hillside.net/europlop
SugarLoaf PLoP
VikingPLoP
ChiliPLoP
KoalaPLoP
Using Patterns (UP)
29 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
30. “Culture”
“5a: the integrated pattern of human knowledge, belief, and behavior that
depends upon man's capacity for learning and transmitting knowledge to
succeeding generations
“5b : the customary beliefs, social forms, and material traits of a religious, or
social group
“5c : the set of shared attitudes, values, goals, and practices that characterizes
a company or corporation”
– Merriam Webster Collegiate Dictionary on the web http://www.m-
w.com/dictionary.htm
Shared experiences
Shared rituals
Writers’ Workshop
Shared values
30 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
31. Writers’ Workshops
Good patterns are highly reviewed and refined.
Writers’ Workshop from the literature/poetry community are used to review
patterns.
Structured discussion of the merits and suggestions for improvement.
Author is present for note taking but does not participate except at very
specific times.
A strong moderator role to guide discussion.
Authors are expected to revise and improve their patterns.
31 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
32. After writing, workshopping and revising: publish
Patterns are meant to be read!
Conference proceedings
hillside.net/conferences points to proceedings of PLoP and EuroPLoP
EuroPLoP, SugarLoaf PLoP and VikingPLoP publish hard copy proceedings
PLoP and EuroPLoP publish proceedings in ACM Digital Library.
Transactions on Pattern Languages of Programming
(hillside.net/tplop)
Books
hillside.net/patterns/books/index.htm for a partial index
32 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
33. Pattern Ethics
Buschmann’s rule: Never capture your own ideas in a pattern
- Focus on broad, lasting, positive patterns
Intellectual currency paradox: Ideas are worth more if given away
• The author should retain ownership and copyright
“Aggressive Disregard for Originality” (Brian Foote)
Let’s encourage people to be secure in telling their secrets
Let’s reward people who created these techniques or who first took the trouble
to commit them to writing
Patterns are solutions that have withstood the test of time
Don’t Hype!
33 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
34. Using Patterns
34 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
35. “Patterns Generate Architectures”
Johnson, OOPSLA ’92
“Documenting Frameworks using Patterns”
Documented a framework using patterns
Beck and Johnson ECOOP ’94
“Patterns Generate Architectures”
Derived an architecture for a HotDraw
interactive graphics system using patterns
35 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
36. Documenting Architecture
Patterns are useful to document built systems.
Allows maintenance engineers a snapshot of the designer’s thinking.
Points out to the future maintainers/enhancers where the “load bearing walls”
are.
Parnas & Clements: “A Rational Design Process: How and Why to Fake It”.
Example:
Architectural training for the 4ESS Switch project in Lucent Technologies
4ESS Switch design begun early 1970’s. First office application January 1976.
New enhancements are still being added.
Training uses patterns document key principles.
36 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
37. Assisting Design
If you were designing an alarm component for a system, the Telecom IO Alarm
patterns might be helpful.
Alarm Grid
Audible Alarm
Office Alarms
Don’t Let Them Forget
By examining these patterns you will see how to build such a component, and the
order in which you should think about using them.
37 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
38. Designing with Relevant Patterns
When starting a project that patterns and pattern languages might be useful for:
Create a list of the relevant patterns from the handbook (i.e. all available resources)
Example: to build a garden, Alexander suggests these patterns:
Half-Hidden Garden Building Edge
Terraced Slope Sunny Place
Fruit Trees Outdoor Room
Tree Places Six-Foot Balcony
Garden Growing Wild Connection to the Earth
Entrance Transition Greenhouse
Courtyards Which Live Garden Seat
Roof Garden TTWOB, p 310
38 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
39. Using a Pattern language … “Never the same way twice.”
Applying a pattern language is not a “turn the crank” exercise.
Every application of patterns or pattern languages must be customized for the
situation at hand.
Every situation poses unique problems.
Every situation requires a unique solution.
The pattern maps described earlier represent one way that the patterns can be
combined to create a solution.
39 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
40. Where do you find the patterns that you need?
Pattern Almanac
Lists all the patterns published up to mid-2000.
Web
Many websites contain links to patterns exist now.
hillside.net
www.welie.com
PLOP proceedings, TPLoP and PLOPD books.
Special topic books.
Basically: be familiar with the Handbook.
40 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
42. Pattern mining
“… don’t count on being able to ‘mine’ a pattern language. A pattern language
comes together like a jigsaw puzzle from patterns that have been collected over
months, years or decades. At some point it becomes publishable, but its
evolution doesn’t cease at that same point.”
– Coplien, C++ Report: Pattern Languages
42 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
43. Digging deeper
What is required for this pattern to work?
What if absent would mean that this cannot work?
What’s missing?
“When every pattern has its principle components given by the smaller patterns
which lie immediately below it in the language, then the language is complete.”
– TTWOB, p 322.
43 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
44. Pattern Refactoring
Real Time and Resource Overload is an example of pattern refactoring.
It combines patterns from previous works into a language.
Meszaros, “A Pattern Language for Improving the Capacity of Reactive
Systems”, PLOPD-2, ch 35.
Hanmer and Wu, “Traffic Congestion”, PLoP 1999 Proceedings.
Real Time and Resource overload Workshopped at PLOP 2000 conference.
Refactored again and included in Patterns for Fault Tolerant Software.
44 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
45. Pattern Refactoring (2)
The pattern you are about to write to complete a language might already have
been written by someone else.
Can you cite it and move on?
Do you need to rephrase it (continuing to give the original authors credit of
course) to fit in your language?
45 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
46. Pattern Research
Current Efforts
The Open Problem
46 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
47. Handbook of Software Architecture
Grady Booch is collecting The Handbook of Software Architecture.
http://www.handbookofsoftwarearchitecture.com
47 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
48. HCI Repository
Martijn van Welie has a repository of HCI patterns that many say is the
cornerstone of the HCI community. http://www.welie.com
48 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
49. Open Problem
Finding appropriate patterns
Many sources: books, web, articles
Many patterns with the same name: Null object, Shed Load
No centralized coordination
Some attempts to resolve
Many student projects to build repositories
Repository sites that wither and die
?
2000 2010
49 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
50. Patterns in your Community
50 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
51. Bioinformatics Open Source Patterns
How can you make use of patterns to foster development of “better”
bioinformatics software?
Does that heading make sense?
What are the patterns that you have already mined?
What do you do with patterns?
Is there a repository?
Is there a “keeper” of the repository?
51 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
53. We’ve looked at
What pattern and pattern languages look like
Pattern communities
Some ways of using patterns
Some ideas about mining your patterns
The repository and indexing problem
Some thoughts about Bioinformatics patterns
53 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
54. Software Patterns for Reusable Design
A software pattern is a description of modular proven solution to a design
problem with enough information so that the reader can flexibly adapt it to their
unique situation.
A form of architectural documentation
An element of the pattern handbook
Is it part of the Handbook of Bioinformatics Open Source Software?
Questions?
54 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
55. References
Sources of more information
55 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
56. References (1)
Alexander, C. et. al. A Pattern Language. New York: Oxford University Press. 1977.
Alexander, C. The Timeless Way of Building. New York: Oxford University Press. 1979.
Beck, K. and R. Johnson, “Patterns Generate Architectures,” Object-Oriented
Programming 8th European Conference (ECOOP ’94), Springer-Verlag, 1994.
Coplien, J. O. Software Patterns. New York: SIGS Publications. 1996.
Gabriel, R. P. Patterns of Software. New York: Oxford University Press. 1996.
Gamma, E., R. Helm, R. Johnson and J. Vlissides. Design Patterns: Elements of Re-usable
object-Oriented Design. Addison-Wesley. 1994.
Hanmer, R. S. and G. Stymfal, “An Input and Output Pattern Language: Lessons from
Telecommunications”, in [14], pp 502-536.
Hanmer, R. S. Patterns for Fault Tolerant Software, Chichester: John Wiley & Sons. 2007.
Hanmer, R. S. “Using Patterns to Teach Software Architecture,” Proceedings of the 6th
Biennial World Conference on Integrated Design and Process Technology, Pasadena,
CA, June, 2002.
56 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
57. References (2)
Harrison, N., B. Foote, H. Rohnert, eds. Pattern Languages of Program Design-4.
Reading, MA: Addison-Wesley, 2000.
PLOPD – PLOPD5: Pattern Languages of Program Design, volumes 1-5. Various editors.
Reading, MA: Addison-Wesley, 1995-2006.
PLoP Conference Proceedings: http://hillside.net/plop/
POSA volumes: Pattern Oriented Software Architecture, volumes 1-5. Various authors.
Chichester, John Wiley & Sons, 1996-2007.
Rising, L. The Pattern Alamanac 2000. Reading, MA: Addison-Wesley, 2000.
Rising, L. The Pattern Handbook. Cambridge: Cambridge University Press, 1998.
For more books see: http://hillside.net/patterns/books/index.htm
For pattern mailing lists see: http://hillside.net/patterns/mailing.htm
57 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
58. www.alcatel-lucent.com
www.alcatel-lucent.com
58 | Software Patterns for Reusable Design | June 2009 All Rights Reserved © Alcatel-Lucent 2009
Notes de l'éditeur Agenda Pages This page allows for the listing of the sections within a presentation. Divider Section Break Pages Title block set 28/32pt Trebuchet white, flush left with text box positioned at, Horizontal 1.87” and Vertical 2.87” This slide is to be used to create Section Divider slides Please copy, paste and modify this slide to reflect your specific needs. It is not generated from a Master slide template Divider Section Break Pages Title block set 28/32pt Trebuchet white, flush left with text box positioned at, Horizontal 1.87” and Vertical 2.87” This slide is to be used to create Section Divider slides Please copy, paste and modify this slide to reflect your specific needs. It is not generated from a Master slide template Divider Section Break Pages Title block set 28/32pt Trebuchet white, flush left with text box positioned at, Horizontal 1.87” and Vertical 2.87” This slide is to be used to create Section Divider slides Please copy, paste and modify this slide to reflect your specific needs. It is not generated from a Master slide template Divider Section Break Pages Title block set 28/32pt Trebuchet white, flush left with text box positioned at, Horizontal 1.87” and Vertical 2.87” This slide is to be used to create Section Divider slides Please copy, paste and modify this slide to reflect your specific needs. It is not generated from a Master slide template Divider Section Break Pages Title block set 28/32pt Trebuchet white, flush left with text box positioned at, Horizontal 1.87” and Vertical 2.87” This slide is to be used to create Section Divider slides Please copy, paste and modify this slide to reflect your specific needs. It is not generated from a Master slide template Divider Section Break Pages Title block set 28/32pt Trebuchet white, flush left with text box positioned at, Horizontal 1.87” and Vertical 2.87” This slide is to be used to create Section Divider slides Please copy, paste and modify this slide to reflect your specific needs. It is not generated from a Master slide template