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
130
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
99
Continuous Integration, fast builds and Flot
cbushell
2
58
Other Decks in Programming
See All in Programming
『品質』という言葉が嫌いな理由
korimu
0
160
データの整合性を保つ非同期処理アーキテクチャパターン / Async Architecture Patterns
mokuo
45
16k
SwiftUI Viewの責務分離
elmetal
PRO
1
220
さいきょうのレイヤードアーキテクチャについて考えてみた
yahiru
3
740
なぜイベント駆動が必要なのか - CQRS/ESで解く複雑系システムの課題 -
j5ik2o
9
3.4k
Rails アプリ地図考 Flush Cut
makicamel
1
110
富山発の個人開発サービスで日本中の学校の業務を改善した話
krpk1900
4
380
2024年のkintone API振り返りと2025年 / kintone API look back in 2024
tasshi
0
220
SwiftUIで単方向アーキテクチャを導入して得られた成果
takuyaosawa
0
270
バックエンドのためのアプリ内課金入門 (サブスク編)
qnighy
8
1.8k
CNCF Project の作者が考えている OSS の運営
utam0k
6
710
負債になりにくいCSSをデザイナとつくるには?
fsubal
9
2.4k
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
The Cult of Friendly URLs
andyhume
78
6.2k
Why Our Code Smells
bkeepers
PRO
336
57k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
4
410
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
99
18k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
29
1k
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.5k
Designing for humans not robots
tammielis
250
25k
The Invisible Side of Design
smashingmag
299
50k
A Modern Web Designer's Workflow
chriscoyier
693
190k
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