Upgrade to Pro — share decks privately, control downloads, hide ads and more …

DDD + Flux?

fand/amagitakayosi
September 08, 2015
4.6k

DDD + Flux?

fand/amagitakayosi

September 08, 2015
Tweet

Transcript

  1. DDD + Flux?
    @amagitakayosi

    View full-size slide

  2. Implementing
    Domain
    Driven
    Design

    View full-size slide

  3. ͱࢥͬͨ͜ͱΛ঺հ͠·͢
    㵺㱿㵺
    ɻP 'MVYͰ͸ʁ

    View full-size slide

  4. %JTQBUDIFS $PNQPOFOU
    4UPSF
    "DUJPO
    %BUB
    Flux

    View full-size slide

  5. %JTQBUDIFS $PNQPOFOU
    #BS"DUJPO
    'PP4UPSF
    'PP
    'PP"DUJPO
    #BS4UPSF
    #BS
    Store͕૿͑Δͱ…

    View full-size slide

  6. Domain-Driven Design
    • ϏδωεϩδοΫΛυϝΠϯʹ෼ׂ
    • ΞϓϦέʔγϣϯ = υϝΠϯͷू߹
    • ϩδοΫͱ࣮૷ͷ෼཭Λॏࢹ

    View full-size slide

  7. %JTQBUDIFS $PNQPOFOU
    #BS"DUJPO
    'PP4UPSF
    'PP
    'PP"DUJPO
    #BS4UPSF
    #BS
    Store͕૿͑Δͱ…

    View full-size slide

  8. %JTQBUDIFS
    $PNQPOFOU
    #BS"DUJPO
    'PP4UPSF
    'PP
    'PP"DUJPO
    #BS4UPSF
    #BS
    Store͕૿͑Δͱ…
    $PNQPOFOU

    View full-size slide

  9. %JTQBUDIFS
    $PNQPOFOU
    #BS"DUJPO
    'PP4UPSF
    'PP
    'PP"DUJPO
    #BS4UPSF
    #BS
    $PNQPOFOU
    FooυϝΠϯ
    BarυϝΠϯ

    View full-size slide

  10. #SPXTFS
    React
    4FSWFS

    View full-size slide

  11. Store
    "1*
    %#
    4FSWJDF΋4UPSF্Ͱ࣮૷͢Δʂʂʂ

    View full-size slide

  12. Command Query
    Responsibility Segregation
    • ௚༁͢ΔͱʮίϚϯυΫΤϦ੹೚෼཭ʯ
    • ίϚϯυ : ঢ়ଶΛมߋ͢Δ
    • ΫΤϦ : ঢ়ଶΛऔಘ͢Δ
    • ঢ়ଶͷऔಘํ๏Λ੍ݶ͠ɺߟ͑ΔࣄΛݮΒ͢

    View full-size slide

  13. FluxͱCQRS
    • Action ≒ Command ?
    • Store͸ɺߋ৽ͷͳ͍ActionΛແࢹ͢Δ
    • Store.getState() ≒ Query ?
    • StoreΛ௚઀มߋ͢Δͷ͸ !

    View full-size slide

  14. 4UPSF
    "DUJPO
    %JTQBUDIFS
    $PNQPOFOU
    .PEFM

    View full-size slide

  15. Event
    Sourcing

    View full-size slide

  16. EventSourcing
    • ू໿ΛΠϕϯτͷγʔέϯε͔Β࡞Δ
    • ݱࡏͷঢ়ଶ = ॳظঢ়ଶ + Πϕϯτ
    • CommandͷΈอଘ͢Ε͹ྑ͍
    • ActionΛه࿥͍ͯ͠Ε͹͓̺

    View full-size slide

  17. DispatcherͰه࿥ͯ͠ΈΔ
    • facebook/flux ͷ Dispatcher Λ֦ு
    • Πϕϯτͱ࣌ࠁΛه࿥
    • replayػೳ

    View full-size slide

  18. σϞ
    http://gmork.in/rec-act/

    View full-size slide

  19. ·ͱΊ
    • Store = υϝΠϯͱ࣮૷Λͭͳ͙ϙʔτ
    • Entity͸Storeʹஔ͘
    • Redux౳ͩͱEntity࣋ͪʹ͍͘
    • ΈΜͳͰStoreߏ଄Խͯ͜͠ʂʂʂʂ

    View full-size slide