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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
手戻りゼロ? Spec Driven Developmentとは@KAG AI week
tmhirai
1
160
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
390
PJのドキュメントを全部Git管理にしたら、一番喜んだのはAIだった
nanaism
0
240
nilとは何か 〜interfaceの構造とnil!=nilから理解する〜
kuro_kurorrr
3
1.6k
Python’s True Superpower
hynek
0
200
AI活用のコスパを最大化する方法
ochtum
0
120
CSC307 Lecture 12
javiergs
PRO
0
460
Windows on Ryzen and I
seosoft
0
120
Fundamentals of Software Engineering In the Age of AI
therealdanvega
1
190
grapheme_strrev関数が採択されました(あと雑感)
youkidearitai
PRO
1
210
Rubyと楽しいをつくる / Creating joy with Ruby
chobishiba
0
210
浮動小数の比較について
kishikawakatsumi
0
380
Featured
See All Featured
Tell your own story through comics
letsgokoyo
1
830
A better future with KSS
kneath
240
18k
The Curious Case for Waylosing
cassininazir
0
260
Everyday Curiosity
cassininazir
0
150
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
62
51k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.6k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.2k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
770
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
60
42k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
0
450
The Art of Programming - Codeland 2020
erikaheidi
57
14k
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