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

Clean Architecture 3

Clean Architecture 3

Takuma Shimizu

September 12, 2018
Tweet

More Decks by Takuma Shimizu

Other Decks in Programming

Transcript

  1. $MFBO"SDIJUFDUVSF

    $PDPB 5PVDI
    .7$
    ਗ਼ਫˏେࡕ

    View full-size slide

  2. $MFBO"SDIJUFDUVSF

    $PDPB 5PVDI
    .7$
    Ұ෦ΦϨΦϨղऍ

    View full-size slide

  3. ໔੹
    w ެࣜυΩϡϝϯτ͕ݹ͍
    w 4XJGUʹ͸ෆ޲͖ʹͳ͍ͬͯΔ΋ͷ΋ݟड͚ΒΕ·͢
    w ঺հ͢Δ΋ͷ͕શ෦͕ϕετϓϥΫςΟεͱ͍͏Θ͚Ͱ͸
    ͋Γ·ͤΜ
    ࠷ݹͷυΩϡϝϯτͩͱ
    ࠷ऴߋ৽೔͕೥ۙ͘લʜ

    View full-size slide

  4. 5SBEJUJPOBM.7$
    IUUQTEFWFMPQFSBQQMFDPNMJCSBSZBSDIJWFEPDVNFOUBUJPO(FOFSBM$PODFQUVBM$PDPB&ODZDMPQFEJB.PEFM7JFX$POUSPMMFS.PEFM7JFX$POUSPMMFSIUNM

    View full-size slide

  5. $PDPB.7$
    IUUQTEFWFMPQFSBQQMFDPNMJCSBSZBSDIJWFEPDVNFOUBUJPO(FOFSBM$PODFQUVBM$PDPB&ODZDMPQFEJB.PEFM7JFX$POUSPMMFS.PEFM7JFX$POUSPMMFSIUNM
    ͳΜ͔εοΩϦ

    View full-size slide

  6. .7$$POUSPMMFS
    w 4USBUFHZύλʔϯ
    w 7JFXͷΠϕϯτͳͲΛղऍͯ͠.PEFMʹదͨ͠ܗʹม͑ͯ
    ఻͑Δ
    w .PEFMͷมߋ௨஌ͳͲΛը໘ʹදࣔʹదͨ͠ܗʹม͑ͯ
    7JFXʹ఻͑Δ
    w 7JFXͱ.PEFMͷ࠶ར༻ੑΛߴΊΔ
    w $POUSPMMFSࣗ਎ͷ࠶ར༻ੑ͸٘ਜ਼ʹͳΔ

    View full-size slide

  7. $MFBO"SDIJUFDUVSFT
    1SFTFOUFST

    View full-size slide

  8. 1SFTFOUFS
    w )VNCMFPCKFDUύλʔϯ
    w ςετͷ͠΍͢͞Λߟྀͨ͠ύλʔϯ
    w ςετ͠΍͍͢ΦϒδΣΫτͱ

    ςετͮ͠Β͍ΦϒδΣΫτΛ෼͚Δ
    ςετ͠΍͍͢ɿ1SFTFOUFS
    ςετͮ͠Β͍ɿ7JFX
    w ౉͖ͬͯͨΦϒδΣΫτΛ7JFX͕ཧղͰ͖Δܗʹ࡞Γม
    ͑Δ
    1SFTFOUFS7JFXͷ࡞Γ͸
    ςετՄೳੑΛ্͛ͨ݁Ռ

    View full-size slide

  9. )VNCMFPCKFDU
    6TF$BTF 1SFTFOUFS
    7JFX
    )VNCMF

    %BUF
    %BUF'PSNBUUFS
    $BMFOEBS
    5JNF;POF
    %BUF
    4USJOH

    View full-size slide

  10. )VNCMFPCKFDU
    6TF$BTF 1SFTFOUFS
    7JFX
    )VNCMF

    ܾࢉ৘ใ
    ७རӹ
    ࠇࣈɾ੺ࣈ൑ఆ
    4USJOH

    #PPMPS
    $PMPS
    ܾࢉ৘ใ

    View full-size slide

  11. )VNCMFPCKFDU
    w ςετ͠΍͍͢ΦϒδΣΫτͱ

    ςετͮ͠Β͍ΦϒδΣΫτΛ෼͚Δ
    w 1SFTFOUFS͸ΠϯϓοτͱΞ΢τϓοτ͕໌֬ʹͳΔ
    w 7JFX͸୯ମςετ͕ෆཁʹͳΓ

    6*ςετ 9$6*5FTU
    ʹूதͰ͖Δ
    w 1SFTFOUFS͸౉͖ͬͯͨΦϒδΣΫτΛ7JFX͕ཧղͰ͖
    Δܗʹ࡞Γม͑Δ

    View full-size slide

  12. .7$$POUSPMMFS
    w .PEFMͷมߋ௨஌ͳͲΛը໘ʹදࣔʹదͨ͠ܗʹม͑ͯ
    7JFXʹ఻͑Δ
    1SFTFOUFS
    w ౉͖ͬͯͨΦϒδΣΫτΛ7JFX͕ཧղͰ͖Δܗʹ࡞Γม
    ͑Δ

    View full-size slide

  13. 1SFTFOUFS$POUSPMMFS
    $POUSPMMFSͬͯͲ͔͜ʹ΋
    ͋ͬͨΑ͏ͳʜ

    View full-size slide

  14. $MFBO"SDIJUFDUVSFT
    $POUSPMMFST

    View full-size slide

  15. $"$POUSPMMFS
    w 7JFXΛ௨ͯ͠ൃੜͨ͠ϢʔβʔೖྗΛ6TF$BTFʹదͨ͠
    ܗʹม͑ͯ఻͑Δ
    w ࠷ऴతʹ1SFTFOUFSʹ੍ޚ͕ҠΔɹ͜Εˠ

    View full-size slide

  16. $"$POUSPMMFS
    w 7JFXΛ௨ͯ͠ൃੜͨ͠ϢʔβʔೖྗΛ6TF$BTFʹద͠
    ͨܗʹม͑ͯ఻͑Δ
    w ࠷ऴతʹ1SFTFOUFSʹ੍ޚ͕ҠΔ

    View full-size slide

  17. .7$$POUSPMMFS
    w 7JFXͷΠϕϯτͳͲΛղऍͯ͠.PEFMʹదͨ͠ܗʹม͑
    ͯ఻͑Δ
    $"$POUSPMMFS
    w 7JFXΛ௨ͯ͠ൃੜͨ͠ϢʔβʔೖྗΛ6TF$BTFʹదͨ͠
    ܗʹม͑ͯ఻͑Δ

    View full-size slide

  18. $POUSPMMFS$POUSPMMFS
    (

    View full-size slide

  19. $PDPB.7$
    IUUQTEFWFMPQFSBQQMFDPNMJCSBSZBSDIJWFEPDVNFOUBUJPO(FOFSBM$PODFQUVBM$PDPB&ODZDMPQFEJB.PEFM7JFX$POUSPMMFS.PEFM7JFX$POUSPMMFSIUNM
    $"తʹ΋ґଘͷҰํ޲ੑ͕
    ഁ୼ͯ͠Δ

    View full-size slide

  20. $PDPB.7$
    IUUQTEFWFMPQFSBQQMFDPNMJCSBSZBSDIJWFEPDVNFOUBUJPO(FOFSBM$PODFQUVBM$PDPB&ODZDMPQFEJB.PEFM7JFX$POUSPMMFS.PEFM7JFX$POUSPMMFSIUNM

    View full-size slide

  21. $PDPB$POUSPMMFS
    w $POUSPMMFS͕ͻͱͭͱ͸୭΋ݴ͍ͬͯͳ͍

    w .FEJBUJOHDPOUSPMMFS
    w $PPSEJOBUJOHDPOUSPMMFS

    View full-size slide

  22. .FEJBUJOH
    w ͜Ε·Ͱઆ໌͖ͯͨ͠.7$$POUSPMMFSͷ໾ׂ
    w NBD04ΞϓϦͷ$PDPB#JOEJOHTͰ࢖༻
    w ΄΅*OUFSGBDF#VJMEFS͚ͩͰ7JFXͱ.PEFM͕ߋ৽઀ଓ
    ͕Մೳ
    w J04Ͱ͸ఏڙ͞Ε͍ͯͳ͍
    w ࣗલͰ΍Δʹ͸*#0VUMFUΛۦ࢖͢Δඞཁ͕͋Δ

    View full-size slide

  23. $PPSEJOBUJOH
    w *OUFSGBDF#VJMEFSͷ'JMF`TPXOFSʹׂΓ౰ͯ
    w ΞϓϦͷશମ·ͨ͸Ұ෦Λ؂ࢹ
    w EFMFHBUF OPUJpDBUJPO DFOUFS
    ʹ൓Ԡ
    w 5BSHFUBDUJPOͷUBSHFUʹͳΓ͏Δ
    ˠ*#"DUJPOΛ࣮૷͢Δ
    εϚϗΞϓϦͷ৔߹
    ೖྗ Πϕϯτ
    ͸7JFXҎ֎
    ͔Β΋΍ͬͯ͘Δ

    View full-size slide

  24. 1SFTFOUFS$POUSPMMFS
    ˣ
    1SFTFOUFS.FEJBUJOH
    DPOUSPMMFS

    View full-size slide

  25. $"$POUSPMMFS$POUSPMMFS
    ˣ
    $"$POUSPMMFS$PPSEJOBUJOH
    DPOUSPMMFS

    View full-size slide

  26. $MFBO"SDIJUFDUVSF

    $PDPB.7$
    6TF$BTF
    1SFTFOUFS
    .FEJBUJOHDPOUSPMMFS

    $POUSPMMFS
    $PPSEJOBUJOHDPOUSPMMFS

    7JFX
    *#"DUJPO
    BT0VUQVUQPSU
    BT*OQVUQPSU
    *OUFSGBDF#VJMEFS
    'JMF`T0XOFS
    /PUJpDBUJPO
    $FOUFS
    %FMFHBUFT
    PXOT

    View full-size slide

  27. $MFBO"SDIJUFDUVSF

    $PDPB5PVDI.7$
    6TF$BTF
    1SFTFOUFS
    .FEJBUJOHDPOUSPMMFS

    $POUSPMMFS
    $PPSEJOBUJOHDPOUSPMMFS

    7JFX
    *#"DUJPO
    BT0VUQVUQPSU
    BT*OQVUQPSU
    *OUFSGBDF#VJMEFS
    'JMF`T0XOFS
    /PUJpDBUJPO
    $FOUFS
    %FMFHBUFT
    PXOT

    View full-size slide

  28. 1SFTFOUFS
    .FEJBUJOHDPOUSPMMFS
    7JFX$POUSPMMFS
    ͸͍ɺ͜͜ΦϨΦϨղऍ
    ͷઌ๝ऀ

    View full-size slide