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
55
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
49
Introduction to Pair Programming
cbushell
1
100
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
110
Branches Are For Trees. How to Develop Software Without Them
cbushell
1
91
Continuous Integration, fast builds and Flot
cbushell
2
54
Other Decks in Programming
See All in Programming
Snowflakeで眠ったデータを起こそう!
estie
0
140
Ruby GitHub Packages
bkuhlmann
0
640
効率化に挑戦してみたらモバイル開発が少し快適になった話
ryunakayama
0
140
Try creating your own orderedmap
kazamori
1
190
VS Code をプロダクトにどう取り込むか
onomax
1
700
Domain-Driven Transformation
hschwentner
2
1.5k
Node.js v22 で変わること
yosuke_furukawa
PRO
11
3.9k
What We Can Learn From OSS
inouehi
0
440
Polars入門
daikikatsuragawa
1
170
新宿ダンジョンを可視化してみた
satoshi7190
3
390
MetricKitで予期せぬ終了を検知する話 / Detect unexpected termination with MetricKit
nekowen
1
200
Git Rebase
bkuhlmann
11
1.6k
Featured
See All Featured
Design by the Numbers
sachag
274
18k
Rebuilding a faster, lazier Slack
samanthasiow
74
8.2k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
245
20k
Music & Morning Musume
bryan
41
5.6k
Fashionably flexible responsive web design (full day workshop)
malarkey
398
65k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3.1k
How GitHub (no longer) Works
holman
305
140k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
65
14k
Mobile First: as difficult as doing things right
swwweet
217
8.6k
Raft: Consensus for Rubyists
vanstee
133
6.3k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
228
16k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
26
2.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