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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Chris Bushell
July 07, 2010
Programming
72
1
Share
State Pattern From GoF
Prepared for the Melbourne Patterns Group
Chris Bushell
July 07, 2010
More Decks by Chris Bushell
See All by Chris Bushell
Test Automation for Packaged Systems: Yes You Can!
cbushell
0
65
Introduction to Pair Programming
cbushell
1
130
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
260
Jasmine, BDD for JavaScript
cbushell
1
130
Branches Are For Trees. How to Develop Software Without Them
cbushell
1
120
Continuous Integration, fast builds and Flot
cbushell
2
79
Other Decks in Programming
See All in Programming
Don't Prompt Harder, Structure Better
kitasuke
0
740
アクセシビリティ試験の"その後"を仕組み化する
yuuumiravy
0
130
CDK Deployのための ”反響定位”
watany
4
730
VueエンジニアがReactを触って感じた_設計の違い
koukimiura
0
170
今こそ押さえておきたい アマゾンウェブサービス(AWS)の データベースの基礎 おもクラ #6版
satoshi256kbyte
1
240
How We Benchmarked Quarkus: Patterns and anti-patterns
hollycummins
1
120
mruby on C#: From VM Implementation to Game Scripting (RubyKaigi 2026)
hadashia
1
210
AI時代のPhpStorm最新事情 #phpcon_odawara
yusuke
0
170
「接続」—パフォーマンスチューニングの最後の一手 〜点と点を結ぶ、その一瞬のために〜
kentaroutakeda
5
2.5k
ルールルルルルRubyの中身の予備知識 ── RubyKaigiの前に予習しなイカ?
ydah
1
170
Swift Concurrency Type System
inamiy
0
490
Coding as Prompting Since 2025
ragingwind
0
830
Featured
See All Featured
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
220
Building AI with AI
inesmontani
PRO
1
890
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.2k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
400
Documentation Writing (for coders)
carmenintech
77
5.3k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
360
So, you think you're a good person
axbom
PRO
2
2k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
What's in a price? How to price your products and services
michaelherold
247
13k
Six Lessons from altMBA
skipperchong
29
4.2k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
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