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
81
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
88
Introduction to Pair Programming
cbushell
1
140
An Introduction to BDD
cbushell
5
190
An Introduction to HTTP
cbushell
2
150
Agile Test Automation
cbushell
2
200
Working Effectively With Legacy Code
cbushell
4
260
Jasmine, BDD for JavaScript
cbushell
1
140
Branches Are For Trees. How to Develop Software Without Them
cbushell
1
130
Continuous Integration, fast builds and Flot
cbushell
2
90
Other Decks in Programming
See All in Programming
PyConJP2026_wat_Python × Signal Processing: How to Draw Pictures with Sound Using Spectrogram Art
wat
0
580
楽しそうなつよつよエンジニアと目が死んでる僕/A brilliant engineer having a blast, and dead-eyed me.
3l4l5
2
260
in-process GraphQL のすすめ #ginzajs
izumin5210
4
1.5k
AWS Transform Customによる Spring Boot 2.xから4.xへのVerUp
satoshi256kbyte
2
110
Detecting Compromised CI with eBPF and Cilium Tetragon
lizrice
0
270
ソフトウェアラスタライザ
fadis
1
730
Japan Community Day at Kubecon + CloudNativeCon Japan 2026: Learning Container Privilege Control by Building My Own Low-Level Container Runtime
ternbusty
1
170
承認済みなのに差戻しできてしまうバグ、型で潰せます
shinchit
0
120
AIの中の人になってみる
htkym
0
140
【QA Test Talk Vol.8】AI-DLC による Whole Team Approach の加速
pkshadeck
PRO
0
250
T3DD26: From RAGs to Riches
martinhelmich
0
120
関東Kaggler会_NVIDIA_Nemotron_コンペ_振り返り
rick_ds
0
730
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.8k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
980
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.9k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Between Models and Reality
mayunak
4
410
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
820
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
430
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
490
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
The Cult of Friendly URLs
andyhume
79
7k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
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