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
64
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
60
Introduction to Pair Programming
cbushell
1
120
An Introduction to BDD
cbushell
5
160
An Introduction to HTTP
cbushell
2
130
Agile Test Automation
cbushell
2
170
Working Effectively With Legacy Code
cbushell
4
250
Jasmine, BDD for JavaScript
cbushell
1
120
Branches Are For Trees. How to Develop Software Without Them
cbushell
1
100
Continuous Integration, fast builds and Flot
cbushell
2
60
Other Decks in Programming
See All in Programming
The Evolution of Enterprise Java with Jakarta EE 11 and Beyond
ivargrimstad
1
510
從零到一:搭建你的第一個 Observability 平台
blueswen
1
780
インターフェース設計のコツとツボ
togishima
2
690
GoのWebAssembly活用パターン紹介
syumai
3
9.3k
赤裸々に公開。 TSKaigiのオフシーズン
takezoux2
0
110
UPDATEがシステムを複雑にする? イミュータブルデータモデルのすすめ
shimomura
1
520
try-catchを使わないエラーハンドリング!? PHPでResult型の考え方を取り入れてみよう
kajitack
3
480
Passkeys for Java Developers
ynojima
2
830
OpenNext + Hono on Cloudflare でイマドキWeb開発スタックを実現する
rokuosan
0
120
Using AI Tools Around Software Development
inouehi
0
1.1k
型安全RESTで爆速プロトタイピング – Hono RPC実践
tacke_jp
0
110
GoのGenericsによるslice操作との付き合い方
syumai
0
150
Featured
See All Featured
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
46
9.6k
Six Lessons from altMBA
skipperchong
28
3.8k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
48
5.4k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
180
53k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Into the Great Unknown - MozCon
thekraken
39
1.8k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.8k
Building Flexible Design Systems
yeseniaperezcruz
328
39k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3k
Code Review Best Practice
trishagee
68
18k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.2k
Product Roadmaps are Hard
iamctodd
PRO
53
11k
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