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
第3回 Snowflake 中部ユーザ会- dbt × Snowflake ハンズオン
hoto17296
4
370
Java Webフレームワークの現状 / java web framework at burikaigi
kishida
9
2.2k
Conform を推す - Advocating for Conform
mizoguchicoji
3
690
“あなた” の開発を支援する AI エージェント Bedrock Engineer / introducing-bedrock-engineer
gawa
11
1.9k
時計仕掛けのCompose
mkeeda
1
290
Amazon ECS とマイクロサービスから考えるシステム構成
hiyanger
2
550
Formの複雑さに立ち向かう
bmthd
1
840
Immutable ActiveRecord
megane42
0
140
パスキーのすべて ── 導入・UX設計・実装の紹介 / 20250213 パスキー開発者の集い
kuralab
3
760
GoとPHPのインターフェイスの違い
shimabox
2
180
Software Architecture
hschwentner
6
2.1k
お前もAI鬼にならないか?👹Bolt & Cursor & Supabase & Vercelで人間をやめるぞ、ジョジョー!👺
taishiyade
6
4k
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
30
2.2k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
The World Runs on Bad Software
bkeepers
PRO
67
11k
Facilitating Awesome Meetings
lara
51
6.2k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
193
16k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
40
2k
The Cult of Friendly URLs
andyhume
78
6.2k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
100
18k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
114
50k
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