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
1
68
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
63
Introduction to Pair Programming
cbushell
1
120
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
250
Jasmine, BDD for JavaScript
cbushell
1
130
Branches Are For Trees. How to Develop Software Without Them
cbushell
1
110
Continuous Integration, fast builds and Flot
cbushell
2
74
Other Decks in Programming
See All in Programming
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
550
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
190
15年続くIoTサービスのSREエンジニアが挑む分散トレーシング導入
melonps
2
180
SourceGeneratorのススメ
htkym
0
190
CSC307 Lecture 09
javiergs
PRO
1
830
Package Management Learnings from Homebrew
mikemcquaid
0
210
例外処理とどう使い分ける?Result型を使ったエラー設計 #burikaigi
kajitack
16
6k
副作用をどこに置くか問題:オブジェクト指向で整理する設計判断ツリー
koxya
1
600
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
120
2026年 エンジニアリング自己学習法
yumechi
0
130
AI巻き込み型コードレビューのススメ
nealle
0
130
今から始めるClaude Code超入門
448jp
8
8.5k
Featured
See All Featured
Mobile First: as difficult as doing things right
swwweet
225
10k
Making the Leap to Tech Lead
cromwellryan
135
9.7k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
62
49k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.9k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Unsuck your backbone
ammeep
671
58k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
350
Bash Introduction
62gerente
615
210k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
72
What does AI have to do with Human Rights?
axbom
PRO
0
2k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
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