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
Kaigi on Railsに初参加したら、その日にLT登壇が決定した件について
tama50505
0
110
どうして手を動かすよりもチーム内のコードレビューを優先するべきなのか
okashoi
3
570
週次リリースを実現するための グローバルアプリ開発
tera_ny
1
110
数十万行のプロジェクトを Scala 2から3に完全移行した
xuwei_k
0
340
毎日13時間もかかるバッチ処理をたった3日で60%短縮するためにやったこと
sho_ssk_
1
330
GitHubで育つ コラボレーション文化 : ニフティでのインナーソース挑戦事例 - 2024-12-16 GitHub Universe 2024 Recap in ZOZO
niftycorp
PRO
0
110
DevFest - Serverless 101 with Google Cloud Functions
tunmise
0
120
ドメインイベント増えすぎ問題
h0r15h0
2
420
見えないメモリを観測する: PHP 8.4 `pg_result_memory_size()` とSQL結果のメモリ管理
kentaroutakeda
0
720
【re:Growth 2024】 Aurora DSQL をちゃんと話します!
maroon1st
0
800
テストケースの名前はどうつけるべきか?
orgachem
PRO
0
150
「とりあえず動く」コードはよい、「読みやすい」コードはもっとよい / Code that 'just works' is good, but code that is 'readable' is even better.
mkmk884
3
730
Featured
See All Featured
Mobile First: as difficult as doing things right
swwweet
222
9k
Visualization
eitanlees
146
15k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Code Reviewing Like a Champion
maltzj
521
39k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Unsuck your backbone
ammeep
669
57k
How STYLIGHT went responsive
nonsquared
96
5.2k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
Scaling GitHub
holman
459
140k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
48
2.2k
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