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
62
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
58
Introduction to Pair Programming
cbushell
1
110
An Introduction to BDD
cbushell
5
160
An Introduction to HTTP
cbushell
2
120
Agile Test Automation
cbushell
2
170
Working Effectively With Legacy Code
cbushell
4
240
Jasmine, BDD for JavaScript
cbushell
1
120
Branches Are For Trees. How to Develop Software Without Them
cbushell
1
98
Continuous Integration, fast builds and Flot
cbushell
2
58
Other Decks in Programming
See All in Programming
創造的活動から切り拓く新たなキャリア 好きから始めてみる夜勤オペレーターからSREへの転身
yjszk
1
140
コンテナをたくさん詰め込んだシステムとランタイムの変化
makihiro
1
150
歴史と現在から考えるスケーラブルなソフトウェア開発のプラクティス
i10416
0
140
Jakarta EE meets AI
ivargrimstad
0
280
PSR-15 はあなたのための ものではない? - phpcon2024
myamagishi
0
180
テストケースの名前はどうつけるべきか?
orgachem
PRO
0
160
[JAWS-UG横浜 #76] イケてるアップデートを宇宙いち早く紹介するよ!
maroon1st
0
510
rails stats で紐解く ANDPAD のイマを支える技術たち
andpad
1
300
暇に任せてProxmoxコンソール 作ってみました
karugamo
2
730
Zoneless Testing
rainerhahnekamp
0
120
テストコード文化を0から作り、変化し続けた組織
kazatohiei
2
1.5k
週次リリースを実現するための グローバルアプリ開発
tera_ny
1
110
Featured
See All Featured
Mobile First: as difficult as doing things right
swwweet
222
9k
Six Lessons from altMBA
skipperchong
27
3.5k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
Being A Developer After 40
akosma
87
590k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
2
290
Practical Orchestrator
shlominoach
186
10k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
530
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Adopting Sorbet at Scale
ufuk
73
9.1k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Reflections from 52 weeks, 52 projects
jeffersonlam
347
20k
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