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
DDD + Flux?
Search
Amagi
September 08, 2015
13
4.9k
DDD + Flux?
Amagi
September 08, 2015
Tweet
Share
More Decks by Amagi
See All by Amagi
Enchant your website with VFX-JS
fand
0
70
How to hack VS Code: evil ways (Japanese)
fand
5
3.5k
READY FOR THE BATTLE? -Introduction to Live Coding-
fand
1
490
GLSL PostEffect in TouchDesigner
fand
2
2k
VEDA GLSL Livecoding workshop
fand
2
5.2k
PWA 方法 無料 今すぐ
fand
3
1.5k
Have you ever heard GPUs cry?
fand
2
3.7k
Real World GLSL
fand
0
250
APIs for VJ-ing
fand
1
6.8k
Featured
See All Featured
Designing for humans not robots
tammielis
250
25k
Bash Introduction
62gerente
610
210k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Reflections from 52 weeks, 52 projects
jeffersonlam
348
20k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
3
240
YesSQL, Process and Tooling at Scale
rocio
170
14k
A better future with KSS
kneath
238
17k
What's in a price? How to price your products and services
michaelherold
244
12k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.8k
StorybookのUI Testing Handbookを読んだ
zakiyama
28
5.4k
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ߏԽͯ͜͠ʂʂʂʂ