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
67
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
120
Branches Are For Trees. How to Develop Software Without Them
cbushell
1
110
Continuous Integration, fast builds and Flot
cbushell
2
66
Other Decks in Programming
See All in Programming
AIのバカさ加減に怒る前にやっておくこと
blueeventhorizon
0
160
CSC509 Lecture 09
javiergs
PRO
0
290
Functional Calisthenics in Kotlin: Kotlinで「関数型エクササイズ」を実践しよう
lagenorhynque
0
110
GitHub Copilotを使いこなせ!/mastering_github_copilot!
kotakageyama
2
870
What’s Fair is FAIR: A Decentralised Future for WordPress Distribution
rmccue
0
150
What's New in Web AI?
christianliebel
PRO
0
120
Bakuraku E2E Scenario Test System Architecture #bakuraku_qa_study
teyamagu
PRO
0
660
Eloquentを使ってどこまでコードの治安を保てるのか?を新人が考察してみた
itokoh0405
0
3.1k
HTTPじゃ遅すぎる! SwitchBotを自作ハブで動かして学ぶBLE通信
occhi
0
230
2026年向け会社紹介資料
misu
0
150
歴史から学ぶ「Why PHP?」 PHPを書く理由を改めて理解する / Learning from History: “Why PHP?” Rediscovering the Reasons for Writing PHP
seike460
PRO
0
140
CSC509 Lecture 10
javiergs
PRO
0
170
Featured
See All Featured
Principles of Awesome APIs and How to Build Them.
keavy
127
17k
Large-scale JavaScript Application Architecture
addyosmani
514
110k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.2k
Thoughts on Productivity
jonyablonski
73
4.9k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
Done Done
chrislema
186
16k
Testing 201, or: Great Expectations
jmmastey
46
7.8k
How to Ace a Technical Interview
jacobian
280
24k
The Art of Programming - Codeland 2020
erikaheidi
56
14k
Art, The Web, and Tiny UX
lynnandtonic
303
21k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.7k
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