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
Architecting Your Project with a Finite-State M...
Search
Patrick Seda
February 24, 2017
Programming
1
2.2k
Architecting Your Project with a Finite-State Machine
Patrick Seda
February 24, 2017
Tweet
Share
More Decks by Patrick Seda
See All by Patrick Seda
The API of Your Company Culture
pxtrick
3
980
Lightning Talk - Enhancing Vue and Vuex for Complex Application State
pxtrick
1
1.2k
Swift - Beyond Beginner
pxtrick
0
1.3k
Crossing the Chasm of Swift
pxtrick
0
1.4k
Your Code is Terrible (I Love It!)
pxtrick
0
1.2k
An Introduction to Location-Based Technologies (for Business & Marketing)
pxtrick
0
600
The Passion of Lazy - Enterprise Mobile App Design Patterns
pxtrick
0
2.2k
10 Tips for Kickass Enterprise Mobile Apps
pxtrick
0
1k
Making Mobile Games (A presentation for the Girl Scouts)
pxtrick
1
700
Other Decks in Programming
See All in Programming
AI主導でFastAPIのWebサービスを作るときに 人間が構造化すべき境界線
okajun35
0
560
SourceGeneratorのマーカー属性問題について
htkym
0
160
PostgreSQL を使った快適な go test 環境を求めて
otakakot
0
410
オブザーバビリティ駆動開発って実際どうなの?
yohfee
3
690
Head of Engineeringが現場で回した生産性向上施策 2025→2026
gessy0129
0
210
DSPy入門 Pythonで実現する自動プロンプト最適化 〜人手によるプロンプト調整からの卒業〜
seaturt1e
1
540
Windows on Ryzen and I
seosoft
0
120
Python’s True Superpower
hynek
0
200
守る「だけ」の優しいEMを抜けて、 事業とチームを両方見る視点を身につけた話
maroon8021
3
290
TipKitTips
ktcryomm
0
150
AI活用のコスパを最大化する方法
ochtum
0
120
JPUG勉強会 OSSデータベースの内部構造を理解しよう
oga5
2
230
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
698
190k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
99
Typedesign – Prime Four
hannesfritz
42
3k
sira's awesome portfolio website redesign presentation
elsirapls
0
180
4 Signs Your Business is Dying
shpigford
187
22k
Building the Perfect Custom Keyboard
takai
2
710
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
Un-Boring Meetings
codingconduct
0
220
Into the Great Unknown - MozCon
thekraken
40
2.3k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.4k
BBQ
matthewcrist
89
10k
Transcript
Architecting Your Project with a Finite-State Machine DEVNEXUS Atlanta –
February 24, 2017
Patrick Seda @pxtrick - CTO of Colligo Vox - Mobile/Technology
Solutions Consulting - 25+ Years as a Software Professional - Apps: Enterprise to Children’s games
None
None
Track State ? How Do We
Booleans, Constants, Strings
None
Finite-State Machine!
- Abstract machine - Can be in exactly one of
a finite number of states at a time - State changes via input events - Transitions - Module finite-state machine
finite-state machine Door Closed Door Open open close
Configuring The FSM
configuring // JSON example ... var config = { states:
{ ‘DoorClosed’: { events: { ‘open’: { toState: ‘DoorOpen’} } }, ‘DoorOpen’: { events: { ‘close’: { toState: ‘DoorClosed’} } } }, startState: ‘DoorClosed’ };
Home Security System! Let’s Design a
a security system
A Honeywell Security System
Armed Stay Armed Away Armed Max Exit Delay? Entry Delay?
Motion? No Yes Yes Yes Yes No No Yes Yes Armed Instant No No No a honeywell system
“Armed Away” a honeywell system
“Armed Max” a honeywell system
“Armed Stay” a honeywell system
“Armed Instant” a honeywell system
a honeywell system
The State Pattern
state pattern • Separates interface from implementation • Enables interchangeable
behavior • Perfect for a state machine! Context State State A State B handle() handle() handle()
state pattern Handler State Armed Disarmed handle() handle() handle() Alarming
handle() for our home security system …
The System In Motion
Architectural Big Picture
big picture Event Handler Disarmed State State State Armed FSM
big picture Visual Status Audible Status Emergency Services Web Backend
Keypad Sensors
None
[email protected]
linkedin.com/in/patrickseda speakerdeck.com/pxtrick podcast: techmatters.fm Patrick Seda @pxtrick