Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
State Pattern From GoF
Search
Chris Bushell
July 07, 2010
Programming
1
62
State Pattern From GoF
Prepared for the Melbourne Patterns Group
Chris Bushell
July 07, 2010
Tweet
Share
More Decks by Chris Bushell
See All by Chris Bushell
Test Automation for Packaged Systems: Yes You Can!
cbushell
0
53
Introduction to Pair Programming
cbushell
1
110
An Introduction to BDD
cbushell
5
160
An Introduction to HTTP
cbushell
2
120
Agile Test Automation
cbushell
2
170
Working Effectively With Legacy Code
cbushell
4
240
Jasmine, BDD for JavaScript
cbushell
1
120
Branches Are For Trees. How to Develop Software Without Them
cbushell
1
97
Continuous Integration, fast builds and Flot
cbushell
2
56
Other Decks in Programming
See All in Programming
ECMAScript、Web標準の型はどう管理されているか / How ECMAScript and Web standards types are maintained
petamoriken
3
390
Rubyとクリエイティブコーディングの輪の広がり / The Growing Circle of Ruby and Creative Coding
chobishiba
1
270
2024 컴포즈 정원사
jisungbin
0
150
Rubyのobject_id
qnighy
6
1.3k
o1モデルのプロンプトエンジニアリングって?
ktc_wada
0
300
ドメイン駆動設計を実践するために必要なもの
bikisuke
4
340
Modern Angular with the NGRX Signal Store New Rules for Your Architecture @BASTA! 2024 in Mainz
manfredsteyer
PRO
0
160
GraphQLの魅力を引き出すAndroidクライアント実装
morux2
3
830
上手に付き合うコンポーネントテスト
quramy
1
230
Amazon Neptuneで始める初めてのグラフDB ー グラフDBを使う意味を考える ー
satoshi256kbyte
2
260
Boost Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
530
Crafting Cross-Platform Adventures: Building a Game Engine with Kotlin Multiplatform
dwursteisen
0
220
Featured
See All Featured
Fontdeck: Realign not Redesign
paulrobertlloyd
80
5.1k
Designing on Purpose - Digital PM Summit 2013
jponch
114
6.8k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
32k
Principles of Awesome APIs and How to Build Them.
keavy
125
16k
The Power of CSS Pseudo Elements
geoffreycrofte
71
5.3k
The Cult of Friendly URLs
andyhume
76
6k
The Pragmatic Product Professional
lauravandoore
31
6.2k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
26
1.9k
Product Roadmaps are Hard
iamctodd
PRO
48
10k
Imperfection Machines: The Place of Print at Facebook
scottboms
263
13k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
29
2.6k
What's new in Ruby 2.0
geeforr
340
31k
Transcript
State Pa'ern From GoF Chris Bushell 7th July 2010
Mo<va<on “Allow an object to alter its behavior when
its internal state changes”
Code
Applicability • Behavior depends on state • Opera<ons
have large condi<onal statements which depend on state
Par<cipants
Collabora<ons • Context and Concrete State • Context
is primary interface for clients
Consequences • Localizes state specific behavior. Avoids code
duplica<on • State changes are well defined, atomic opera<ons • State objects can be shared
Implementa<on • Context or Concrete State defines transi<ons?
• Table based approach to defining transi<ons • Singleton, Flyweight