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 Machine
Search
Patrick Seda
February 24, 2017
Programming
1
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
960
Lightning Talk - Enhancing Vue and Vuex for Complex Application State
pxtrick
1
1.1k
Swift - Beyond Beginner
pxtrick
0
1.2k
Crossing the Chasm of Swift
pxtrick
0
1.3k
Your Code is Terrible (I Love It!)
pxtrick
0
1.2k
An Introduction to Location-Based Technologies (for Business & Marketing)
pxtrick
0
590
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
680
Other Decks in Programming
See All in Programming
puregoの活用例
aethiopicuschan
0
220
DDDはなぜ難しいのか / 良いコードの定義と設計能力の壁
pospome
28
10k
Open Source Swift Workshop - Foundation and first party libraries
ikesyo
0
1.1k
コードレビューで学ぶ!Kotlinオブジェクト指向デザインパターン
akkie76
2
170
From Spring Boot 2 to Spring Boot 3 with Java 22 and Jakarta EE
ivargrimstad
0
810
OpenTelemetry のサービスという概念について
azukiazusa1
2
1k
今の SmartHR にエンジニアで入社するとどうなるの?
daisukeshinoku
5
4.6k
Ruby製社内ツールのGo移行
bgpat
2
330
Rubyでたのしむクリエイティブコーディング/Enjoy Creative coding with Ruby
chobishiba
1
160
受託開発でGitLab CI を活用していく
xiombatsg
1
260
甘い香りに誘われてVanilla Extractを1年間運用してみた
miyahkun
1
110
9年開発を牽引して見えてきた、共通化すべきものと個別でつくるもの ~プログラム言語~
shinout
1
640
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
130
6.2k
Done Done
chrislema
178
15k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
272
12k
Building Effective Engineering Teams - LeadDev
addyosmani
26
1.8k
Building Flexible Design Systems
yeseniaperezcruz
318
37k
Product Roadmaps are Hard
iamctodd
43
9.7k
Web Components: a chance to create the future
zenorocha
304
41k
Intergalactic Javascript Robots from Outer Space
tanoku
266
26k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
34
8.8k
Designing with Data
zakiwarfel
95
4.8k
What's new in Ruby 2.0
geeforr
336
31k
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