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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Chris Bushell
July 07, 2010
Programming
72
1
Share
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
65
Introduction to Pair Programming
cbushell
1
130
An Introduction to BDD
cbushell
5
170
An Introduction to HTTP
cbushell
2
130
Agile Test Automation
cbushell
2
180
Working Effectively With Legacy Code
cbushell
4
260
Jasmine, BDD for JavaScript
cbushell
1
130
Branches Are For Trees. How to Develop Software Without Them
cbushell
1
120
Continuous Integration, fast builds and Flot
cbushell
2
79
Other Decks in Programming
See All in Programming
LM Linkで(非力な!)ノートPCでローカルLLM
seosoft
0
480
How Swift's Type System Guides AI Agents
koher
0
250
The Monolith Strikes Back: Why AI Agents ❤️ Rails Monoliths
serradura
0
320
Coding as Prompting Since 2025
ragingwind
0
830
「速くなった気がする」をデータで疑う
senleaf24
0
170
iOS機能開発のAI環境と起きた変化
ryunakayama
0
180
Mastering Event Sourcing: Your Parents Holidayed in Yugoslavia
super_marek
0
150
Feature Toggle は捨てやすく使おう
gennei
0
590
Getting more out of Maven
mlvandijk
0
110
Server-Side Kotlin LT大会 vol.18 [Kotlin-lspの最新情報と Neovimのlsp設定例]
yasunori0418
1
130
Claude Codeをカスタムして自分だけのClaude Codeを作ろう
terisuke
0
120
Going Multiplatform with Your Android App (Android Makers 2026)
zsmb
2
400
Featured
See All Featured
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
200
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
1.9k
Building the Perfect Custom Keyboard
takai
2
730
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.4k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
680
Fireside Chat
paigeccino
42
3.9k
ラッコキーワード サービス紹介資料
rakko
1
3M
A Tale of Four Properties
chriscoyier
163
24k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
Amusing Abliteration
ianozsvald
1
150
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.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