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
65
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
61
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
110
Continuous Integration, fast builds and Flot
cbushell
2
60
Other Decks in Programming
See All in Programming
あなたとKaigi on Rails / Kaigi on Rails + You
shimoju
0
120
Go言語の特性を活かした公式MCP SDKの設計
hond0413
1
230
Six and a half ridiculous things to do with Quarkus
hollycummins
0
140
止められない医療アプリ、そっと Swift 6 へ
medley
1
150
ソフトウェア設計の実践的な考え方
masuda220
PRO
4
550
開発生産性を上げるための生成AI活用術
starfish719
3
420
Server Side Kotlin Meetup vol.16: 内部動作を理解して ハイパフォーマンスなサーバサイド Kotlin アプリケーションを書こう
ternbusty
2
130
詳しくない分野でのVibe Codingで困ったことと学び/vibe-coding-in-unfamiliar-area
shibayu36
3
4.8k
理論と実務のギャップを超える
eycjur
0
120
monorepo の Go テストをはやくした〜い!~最小の依存解決への道のり~ / faster-testing-of-monorepos
convto
2
460
Railsだからできる 例外業務に禍根を残さない 設定設計パターン
ei_ei_eiichi
0
440
After go func(): Goroutines Through a Beginner’s Eye
97vaibhav
0
350
Featured
See All Featured
Designing Experiences People Love
moore
142
24k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
61k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
jQuery: Nuts, Bolts and Bling
dougneiner
64
7.9k
Raft: Consensus for Rubyists
vanstee
139
7.1k
Embracing the Ebb and Flow
colly
88
4.8k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.7k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
114
20k
Building Applications with DynamoDB
mza
96
6.7k
Designing for Performance
lara
610
69k
Documentation Writing (for coders)
carmenintech
75
5k
VelocityConf: Rendering Performance Case Studies
addyosmani
332
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