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
81
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
State Pattern From GoF
Prepared for the Melbourne Patterns Group
Chris Bushell
July 07, 2010
More Decks by Chris Bushell
See All by Chris Bushell
Test Automation for Packaged Systems: Yes You Can!
cbushell
0
88
Introduction to Pair Programming
cbushell
1
140
An Introduction to BDD
cbushell
5
190
An Introduction to HTTP
cbushell
2
150
Agile Test Automation
cbushell
2
200
Working Effectively With Legacy Code
cbushell
4
260
Jasmine, BDD for JavaScript
cbushell
1
140
Branches Are For Trees. How to Develop Software Without Them
cbushell
1
130
Continuous Integration, fast builds and Flot
cbushell
2
90
Other Decks in Programming
See All in Programming
まずはプロンプトガイドを読もう、話はそれからだ
kiakiraki
1
230
業務時間外もAIに働いてもらう話
colorful12
2
8.9k
Press start. Python's next generation.
willingc
PRO
3
270
Introducing Stack Pull Request in GitHub
kkamegawa
0
110
仕様書を書く前にハーネスを作る - Agent Native開発は「探索を速く、判定を固く」
gotalab555
5
1.8k
Pythonの実行はどこまで賢くなったのか? CPythonとPyPyから見る最適化のしくみ
curekoshimizu
4
2.3k
Loosening the Reins: Go Generics Get More Flexible
kuro_kurorrr
0
350
プロポーザルを書いてもらう
pvcresin
0
590
不幸な GC
chencmd
0
820
[PyCon KR 2026] More Variants, More Diversity for AI Accelerators
achimnol
0
120
属人化した知識を、 AIが辿れる地図にする
pkshadeck
PRO
1
220
自動化したのに回らない テスト運用の壁―AI時代の品質責任と生産性
mfunaki
0
540
Featured
See All Featured
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.3k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
310
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.1k
Become a Pro
speakerdeck
PRO
31
6.2k
Discover your Explorer Soul
emna__ayadi
2
1.3k
Writing Fast Ruby
sferik
630
63k
Rails Girls Zürich Keynote
gr2m
96
14k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
480
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
4
510
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
790
Designing for Timeless Needs
cassininazir
1
460
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
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