Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
DDD + Flux?
fand/amagitakayosi
September 08, 2015
13
4.3k
DDD + Flux?
fand/amagitakayosi
September 08, 2015
Tweet
Share
More Decks by fand/amagitakayosi
See All by fand/amagitakayosi
How to hack VS Code: evil ways (Japanese)
fand
5
3.1k
READY FOR THE BATTLE? -Introduction to Live Coding-
fand
1
410
GLSL PostEffect in TouchDesigner
fand
2
1.8k
VEDA GLSL Livecoding workshop
fand
2
4.7k
PWA 方法 無料 今すぐ
fand
3
1.3k
Have you ever heard GPUs cry?
fand
2
3.3k
Real World GLSL
fand
0
180
APIs for VJ-ing
fand
1
6.2k
Style your Components with styled-component!
fand
1
440
Featured
See All Featured
Scaling GitHub
holman
453
140k
Atom: Resistance is Futile
akmur
256
24k
Rails Girls Zürich Keynote
gr2m
87
12k
How GitHub Uses GitHub to Build GitHub
holman
465
280k
Designing the Hi-DPI Web
ddemaree
273
32k
Statistics for Hackers
jakevdp
785
210k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
500
130k
Building Better People: How to give real-time feedback that sticks.
wjessup
346
17k
Practical Orchestrator
shlominoach
178
8.9k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
270
12k
Thoughts on Productivity
jonyablonski
49
2.7k
What's new in Ruby 2.0
geeforr
336
30k
Transcript
DDD + Flux? @amagitakayosi
Implementing Domain Driven Design
ͱࢥͬͨ͜ͱΛհ͠·͢ 㵺㱿㵺 ɻP 'MVYͰʁ
Flux
%JTQBUDIFS $PNQPOFOU 4UPSF "DUJPO %BUB Flux
%JTQBUDIFS $PNQPOFOU #BS"DUJPO 'PP4UPSF 'PP 'PP"DUJPO #BS4UPSF #BS Store͕૿͑Δͱ…
DDD
Domain-Driven Design • ϏδωεϩδοΫΛυϝΠϯʹׂ • ΞϓϦέʔγϣϯ = υϝΠϯͷू߹ • ϩδοΫͱ࣮ͷΛॏࢹ
%JTQBUDIFS $PNQPOFOU #BS"DUJPO 'PP4UPSF 'PP 'PP"DUJPO #BS4UPSF #BS Store͕૿͑Δͱ…
%JTQBUDIFS $PNQPOFOU #BS"DUJPO 'PP4UPSF 'PP 'PP"DUJPO #BS4UPSF #BS Store͕૿͑Δͱ… $PNQPOFOU
%JTQBUDIFS $PNQPOFOU #BS"DUJPO 'PP4UPSF 'PP 'PP"DUJPO #BS4UPSF #BS $PNQPOFOU FooυϝΠϯ
BarυϝΠϯ
#SPXTFS React 4FSWFS
Store "1* %#
Store "1* %# 4FSWJDF4UPSF্Ͱ࣮͢Δʂʂʂ
CQRS
Command Query Responsibility Segregation • ༁͢ΔͱʮίϚϯυΫΤϦʯ • ίϚϯυ : ঢ়ଶΛมߋ͢Δ
• ΫΤϦ : ঢ়ଶΛऔಘ͢Δ • ঢ়ଶͷऔಘํ๏Λ੍ݶ͠ɺߟ͑ΔࣄΛݮΒ͢
FluxͱCQRS • Action ≒ Command ? • Storeɺߋ৽ͷͳ͍ActionΛແࢹ͢Δ • Store.getState()
≒ Query ? • StoreΛมߋ͢Δͷ !
Flux
4UPSF "DUJPO %JTQBUDIFS $PNQPOFOU .PEFM
Flux
Flux
Event Sourcing
EventSourcing • ूΛΠϕϯτͷγʔέϯε͔Β࡞Δ • ݱࡏͷঢ়ଶ = ॳظঢ়ଶ + Πϕϯτ •
CommandͷΈอଘ͢Εྑ͍ • ActionΛه͍ͯ͠Ε͓̺
DispatcherͰهͯ͠ΈΔ • facebook/flux ͷ Dispatcher Λ֦ு • Πϕϯτͱ࣌ࠁΛه • replayػೳ
None
None
σϞ http://gmork.in/rec-act/
·ͱ Ί
·ͱΊ • Store = υϝΠϯͱ࣮Λͭͳ͙ϙʔτ • EntityStoreʹஔ͘ • ReduxͩͱEntity࣋ͪʹ͍͘ •
ΈΜͳͰStoreߏԽͯ͜͠ʂʂʂʂ