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
CSC307 Lecture 17
javiergs
PRO
0
110
💎 My RubyKaigi Effect in 2025: Top Ruby Companies 🌐
yasulab
PRO
1
130
Julia という言語について (FP in Julia « SIDE: F ») for 関数型まつり2025
antimon2
3
890
ktr0731/go-mcpでMCPサーバー作ってみた
takak2166
0
140
事業戦略を理解してソフトウェアを設計する
masuda220
PRO
21
5.8k
Perplexity Slack Botを作ってAI活用を進めた話 / AI Engineering Summit プレイベント
n3xem
0
610
Rails産でないDBを Railsに引っ越すHACK - Omotesando.rb #110
lnit
1
160
実践ArchUnit ~実例による検証パターンの紹介~
ogiwarat
2
240
[初登壇@jAZUG]アプリ開発者が気になるGoogleCloud/Azure+wasm/wasi
asaringo
0
110
Gleamという選択肢
comamoca
6
660
「兵法」から見る質とスピード
ickx
0
260
〜可視化からアクセス制御まで〜 BigQuery×Looker Studioで コスト管理とデータソース認証制御する方法
cuebic9bic
3
320
Featured
See All Featured
The Pragmatic Product Professional
lauravandoore
35
6.7k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
4
120
Designing for Performance
lara
609
69k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
The World Runs on Bad Software
bkeepers
PRO
68
11k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.3k
Rebuilding a faster, lazier Slack
samanthasiow
81
9k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.5k
Being A Developer After 40
akosma
90
590k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
20
1.3k
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