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
77
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
82
Introduction to Pair Programming
cbushell
1
140
An Introduction to BDD
cbushell
5
180
An Introduction to HTTP
cbushell
2
140
Agile Test Automation
cbushell
2
190
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
84
Other Decks in Programming
See All in Programming
Semantic Version 単位で戦略を柔軟に変えて、パッケージアップデートを自動化する
daitasu
1
270
キャリア迷子上等 ─ "ない道"は自分で作ればいい
16bitidol
3
2.2k
ユニットテストの先へ:テスト技法で要求・仕様を整理するJava開発実践 / Beyond_Unit_Testing_Practical_Java_Development_Techniques_for_Organizing_Requirements_and_Specifications
shimashima35
0
410
Webフレームワークの ベンチマークについて
yusukebe
0
170
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
290
JavaDoc 再入門
nagise
1
370
AIで効率化できた業務・日常
ochtum
0
140
「AIで開発し、AIを届ける」をEvalでつなぐ 〜AIネイティブに始めるプロダクト開発の実践〜 / Connecting "Develop with AI, deliver AI" with Eval
rkaga
4
5.3k
Vite+ Unified Toolchain for the Web
naokihaba
0
320
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
720
A2UI という光を覗いてみる
satohjohn
1
140
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
7.1k
Featured
See All Featured
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
1.1k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
210
The Cult of Friendly URLs
andyhume
79
6.9k
Making Projects Easy
brettharned
120
6.7k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.9k
Statistics for Hackers
jakevdp
799
230k
Building an army of robots
kneath
306
46k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
150
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.4k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
320
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.6k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
62
44k
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