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

solid+cqs+dry

 solid+cqs+dry

Shinnosuke Kugimiya

December 16, 2019
Tweet

More Decks by Shinnosuke Kugimiya

Other Decks in Technology

Transcript

  1. X © DMM.com 40-*%ݪଇͱ͸ Լهͷॏཁͳ̑ͭͷݪଇͷ಄จࣈΛͭͳ͛ͨ΋ͷ w 431ʢ୯Ұ੹຿ݪଇʣ w 0$1ʢΦʔϓϯΫϩʔζυݪଇʣ w

    -41ʢϦείϑͷஔ׵ݪଇʣ w *41ʢΠϯλʔϑΣʔε෼཭ͷݪଇʣ w %*1ʢґଘؔ܎ٯసͷݪଇʣ
  2. X © DMM.com BHFOEB 40-*%ݪଇͷॱ൪͸ͦΕ΄Ͳॏཁ͡Όͳ͍ͷͰॱෆಉͰ΍͍͖ͬͯ·͢ w ೔໨ w 431ʢ୯Ұ੹຿ݪଇʣ w

    *41ʢΠϯλʔϑΣʔε෼཭ͷݪଇʣ w %*1ʢґଘؔ܎ٯసͷݪଇʣ w ೔໨ w 0$1ʢΦʔϓϯΫϩʔζυݪଇʣ w -41ʢϦείϑͷஔ׵ݪଇʣ w $24ʢίϚϯυΫΤϦ෼཭ͷݪଇʣ w %3:ʢ%PO`U3FQFBU:PVS4FMGݪଇʣ ̍೔໨ͷ՝୊͸جຊతʹΫϥεਤΛॻ͍ͯ΋Β͍·͢ɻͦͷͨΊɺϊʔτ ϖϯ͕ඞਢͰ͢ɻ ̎೔໨͸ίʔυΛमਖ਼͢Δ՝୊͕ग़ΔͨΊ1$ඞਢͰ͢ɻ
  3. X © DMM.com ௕ํܗɾਖ਼ํܗ໰୊ DMBTT3FDUBOHMF\ QSJWBUFWBSIFJHIU*OU QSJWBUFWBSXJEUI*OU GVOTFU)FJHIU I*OU \

    UIJTIFJHIUI ^ GVOTFU8JEUI X*OU \ UIJTXJEUIX ^ GVOBSFB *OU\ SFUVSOUIJTIFJHIU UIJTXJEUI ^ ^
  4. X © DMM.com ௕ํܗɾਖ਼ํ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TFU8JEUI X  ^ ^ WBMSFDUBOHMF3FDUBOHMF4RVBSF  SFDUBOHMFTFU)FJHIU   SFDUBOHMFTFU8JEUI   BTTFSU SFDUBOHMFBSFB  3FDUBOHMFΛܧঝͨ͠ 4RVBSFΛ࡞ͬͯΈΔ
  8. X © DMM.com ௕ํܗɾਖ਼ํܗ໰୊ DMBTT4RVBSF3FDUBOHMF\ PWFSSJEFGVOTFU)FJHIU I*OU \ TVQFSTFU)FJHIU I

     TVQFSTFU8JEUI I  ^ PWFSSJEFGVOTFU8JEUI X*OU \ TVQFSTFU)FJHIU X  TVQFSTFU8JEUI X  ^ ^ WBMSFDUBOHMF3FDUBOHMF4RVBSF  SFDUBOHMFTFU)FJHIU   SFDUBOHMFTFU8JEUI   BTTFSU SFDUBOHMFBSFB  3FDUBOHMFΛܧঝͨ͠ 4RVBSFΛ࡞ͬͯΈΔ /(
  9. X © DMM.com ௕ํܗɾਖ਼ํܗ໰୊ DMBTT4RVBSF3FDUBOHMF\ PWFSSJEFGVOTFU)FJHIU I*OU \ TVQFSTFU)FJHIU I

     TVQFSTFU8JEUI I  ^ PWFSSJEFGVOTFU8JEUI X*OU \ TVQFSTFU)FJHIU X  TVQFSTFU8JEUI X  ^ ^ WBMSFDUBOHMF3FDUBOHMF4RVBSF  SFDUBOHMFTFU)FJHIU   SFDUBOHMFTFU8JEUI   BTTFSU SFDUBOHMFBSFB  3FDUBOHMFΛܧঝͨ͠ 4RVBSFΛ࡞ͬͯΈΔ /( εʔύʔΫϥεͷಈ͖Λมߋ͢Δܧঝͷ࢓ํΛ͢Δͷ͸΍Ί·͠ΐ͏
  10. X © DMM.com ݸਓతʹ͸͜͜Λ஫ҙͨ͠ํ͕ྑ͍ͱࢥͬͯ·͢ http://martinfowler.com/bliki/CommandQuerySeparation.html w ΫΤϦ݁ՌΛฦ͠ɺγεςϜͷঢ়ଶΛมߋ͠ͳ͍ʢ෭࡞༻ ͕ͳ͍ʣ w ίϚϯυγεςϜͷঢ়ଶΛมߋ͠ɺ஋Λฦ͞ͳ͍

    044Ͱ΋࢓ࣄதͰ΋ΫΤϦΈ͍ͨͳϝιου໊Ͱঢ়ଶΛ มߋͯ͠͠·͍ͬͯΔ΋ͷΛΑ͘ݟ͔͚Δ 4&-&$5จ౤͛Δͨͼʹຖճҧ͏݁ՌΛฦ͢42-ͷΑ͏ͳ΋ͷͳͷͰ΍Ί·͠ΐ͏ɻ
  11. X © DMM.com ݸਓతʹ͸͜͜Λ஫ҙͨ͠ํ͕ྑ͍ͱࢥͬͯ·͢ http://martinfowler.com/bliki/CommandQuerySeparation.html w ΫΤϦ݁ՌΛฦ͠ɺγεςϜͷঢ়ଶΛมߋ͠ͳ͍ʢ෭࡞༻ ͕ͳ͍ʣ w ίϚϯυγεςϜͷঢ়ଶΛมߋ͠ɺ஋Λฦ͞ͳ͍

    044Ͱ΋࢓ࣄதͰ΋ΫΤϦΈ͍ͨͳϝιου໊Ͱঢ়ଶΛ มߋͯ͠͠·͍ͬͯΔ΋ͷΛΑ͘ݟ͔͚Δ 4&-&$5จ౤͛Δͨͼʹຖճҧ͏݁ՌΛฦ͢42-ͷΑ͏ͳ΋ͷͳͷͰ΍Ί·͠ΐ͏ɻ ͋ͱHFU999ͱ͍͏໊લͰฦΓ஋͕WPJEͷϝιουͱ͔΋΍Ί·͠ΐ͏ɻ
  12. X © DMM.com ίʔυॏෳͷྫ Լهͷ-JOFΫϥε͕͋Δ࣌ʹࢸΔॴͰڑ཭ΛٻΊΔͨΊʹ MJOFTUBSUEJTUBODF5P FOE ͕ݺ͹ΕͯΔΑ͏ͳঢ়ଶ DMBTT-JOF\ WBMTUBSU1PJOU

    WBMFOE1PJOU ^ *G MJOFTUBSUEJTUBODF5P MJOFFOE  \ ʜ ^ WBMWMJOFTUBSUEJTUBODF5P MJOFFOE UJNF
  13. X © DMM.com ίʔυॏෳͷྫ Լهͷ-JOFΫϥε͕͋Δ࣌ʹࢸΔॴͰڑ཭ΛٻΊΔͨΊʹ MJOFTUB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ͬͯͳ͍νΣοΫ^ ^ ه߸νΣοΫ͔ͯ͠͠ͳ͍ͷͰҰՕॴʹ·ͱΊΔ /BNF7BMJEBUPSͷΞΫλʔ͕ෳ਺͍Δʢ431ʹҧ൓ͯ͠Δʣ
  17. X © DMM.com ΍Γ͗͢%3:ͷྫ PCKFDU/BNF7BMJEBUPS\ GVOWBMJEBUF OBNF4USJOH #PPMFBO \ه߸ͱ͔ೖͬͯͳ͍νΣοΫ^ ^

    ͦͷޙɺԼهͷΑ͏ͳमਖ਼͕͸͍Δ w 6TFS/BNF͸AʑʍʎʔAΛه߸ͱͯ͠࢖͑ΔΑ͏ʹ͢Δ w $PNQBOZ/BNF͸A` ɾAΛه߸ͱͯ͠࢖͑ΔΑ͏ʹ͢Δ
  18. X © DMM.com ΍Γ͗͢%3:ͷྫ PCKFDU/BNF7BMJEBUPS\ GVOWBMJEBUF OBNF4USJOH #PPMFBO \ه߸ͱ͔ೖͬͯͳ͍νΣοΫ^ ^

    ͦͷޙɺԼهͷΑ͏ͳमਖ਼͕͸͍Δ w 6TFS/BNF͸AʑʍʎʔAΛه߸ͱͯ͠࢖͑ΔΑ͏ʹ͢Δ w $PNQBOZ/BNF͸A` ɾAΛه߸ͱͯ͠࢖͑ΔΑ͏ʹ͢Δ /BNF7BMJEBUPSͷमਖ਼͚ͩͰ͸ݫ͍͠
  19. X © DMM.com ΍Γ͗͢%3:ͷྫ DMBTT6TFS/BNF\ WBMWBMVF4USJOH GVOWBMJEBUF #PPMFBO \ڐՄ͞Εͨه߸Ҏ֎ೖ͍ͬͯͳ͍͔νΣοΫ^ ^

    DMBTT$PNQBOZ/BNF\ WBMWBMVF4USJOH GVOWBMJEBUF #PPMFBO \ڐՄ͞Εͨه߸Ҏ֎ೖ͍ͬͯͳ͍͔νΣοΫ^ ^ ͦͷޙɺԼهͷΑ͏ͳमਖ਼͕͸͍Δ w 6TFS/BNF͸AʑʍʎʔAΛه߸ͱͯ͠࢖͑ΔΑ͏ʹ͢Δ w $PNQBOZ/BNF͸A` ɾAΛه߸ͱͯ͠࢖͑ΔΑ͏ʹ͢Δ ΍Γ͗ͨ͢%3:ͷલͷ431ʹैͬͨ··ͷํ͕ॊೈʹରԠͰ͖Δ
  20. X © DMM.com ݸਓϫʔΫᶃ FOVN4UPSBHF\ 4  'JMF  %#

    ^ DMBTT-PHHFS\ GVOTFOE TUPSBHF4UPSBHF \ XIFO TUPSBHF \ JT4\4ʹอଘ͢Δॲཧ^ JT'JMF\ϩʔΧϧ'JMFʹอଘ͢Δॲཧ^ JT%#\%#ʹૹ৴͢Δॲཧ^
 ^ ^ ^ ࣍ͷίʔυΛݟͯɺݪଇʹैͬͨίʔυʹॻ͖௚ͯ͠Έ· ͠ΐ͏
  21. X © DMM.com ݸਓϫʔΫᶄ ࣍ͷίʔυͷΑ͏ʹFOVN XIFOΛ࢖Θͳ͍Α͏ʹͯ͠ɺॻ ͍ͯΈ·͠ΐ͏ FOVN4UBUF\ &"5 

    4-&&1  $0%& ^ DMBTT)VNBO\ GVOPQFSBUF TUBUF4UBUF \ XIFO TUBUF \ &"5\ ৯͏ ^ 4-&&1\ ৸Δ ^ $0%&\ ίʔυॻ͘ ^ ^ ^
  22. X © DMM.com ݸਓϫʔΫᶅ DMBTT$IBOOFM\ QSJWBUFWBSNFNCFST-JTU.FNCFS QSJWBUFWBSNFTTBHFT-JTU.FTTBHF GVOHFU.FNCFST NF.FNCFS -JTU.FNCFS\

    νϟϯωϧࢀՃ࣌ʹ࠷ॳʹݺ͹ΕΔϝιουͳͷͰɺ͜͜ ͰNFΛNFNCFSTʹ௥Ճ͢Δ NFNCFSTBEE NF  SFUVSONFNCFST ^ GVOHFU.FTTBHFT -JTU.FTTBHF\ NFTTBHFTGPS&BDI\NFTTBHF طಡʹ͢Δ NFTTBHFSFBE  ^ SFUVSONFTTBHFT ^  GVOTFOE.FTTBHF NFTTBHF.FTTBHF -JTU.FTTBHF\ NFTTBHFTBEE NFTTBHF  SFUVSONFTTBHFT ^ ^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