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

DDD Practice in iOS

Masato Oshima
December 15, 2015

DDD Practice in iOS

Masato Oshima

December 15, 2015
Tweet

More Decks by Masato Oshima

Other Decks in Technology

Transcript

  1. DDD practice in iOS
    Shibuya.swift #2

    View full-size slide

  2. Masato Oshima
    github.com/mpon
    @_mpon
    ಢ໦ݝ๕լ܊ग़਎
    iOS Developer

    View full-size slide

  3. J04։ൃͷઃܭͷ
    ೰ΈͲ͜Ζ

    View full-size slide

  4. w'BUͳ7JFX$POUSPMMFS
    w7JFX$POUSPMMFS͕ͨ͘͞Μͷ
    ϑϥάΛ࣋ͬͯঢ়ଶ؅ཧ
    wϢχοτςετͳΜͯॻ͚ͬ͜
    ͳ͍

    View full-size slide

  5. w'BUͳ7JFX$POUSPMMFS
    w7JFX$POUSPMMFS͕ͨ͘͞Μͷ
    ϑϥάΛ࣋ͬͯঢ়ଶ؅ཧ
    wϢχοτςετͳΜͯॻ͚ͬ͜
    ͳ͍
    ਺ઍߦͷ7JFX$POUSPMMFSɺ
    ৔߹෼͚ʹ͋;Εͨ#BTF7JFX$POUSPMMFS

    View full-size slide

  6. w'BUͳ7JFX$POUSPMMFS
    w7JFX$POUSPMMFS͕ͨ͘͞Μͷ
    ϑϥάΛ࣋ͬͯঢ়ଶ؅ཧ
    wϢχοτςετͳΜͯॻ͚ͬ͜
    ͳ͍
    JT'JSTU-PBEFE JT3FRVFTUJOHͳͲͳͲʜ

    View full-size slide

  7. w'BUͳ7JFX$POUSPMMFS
    w7JFX$POUSPMMFS͕ͨ͘͞Μͷ
    ϑϥάΛ࣋ͬͯঢ়ଶ؅ཧ
    wϢχοτςετͳΜͯॻ͚ͬ͜
    ͳ͍ ςετ͢Δʹ͸6*7JFX$POUSPMMFS͕ඞཁɺ
    ωοτϫʔΫ௨৴΋ඞཁɾɾɾ

    View full-size slide

  8. %%%υϝΠϯۦಈઃܭ

    View full-size slide

  9. %%%υϝΠϯۦಈઃܭ

    View full-size slide

  10. wը໘ͷඳը
    wϢʔβʔͷΠϕϯτ
    Λड͚Δ

    View full-size slide

  11. w࣮ߦ͍ͨ͠ॲཧΛߦ
    ͏
    wۀ຿ϩδοΫ
    wσʔλఆٛ

    View full-size slide

  12. wσʔλ௨৴
    wӬଓԽ

    View full-size slide

  13. ॲཧΛߦ͏Ϋϥε

    View full-size slide

  14. ֤छσʔλ
    ௨৴ͨ͠σʔλͳͲ
    6TFSϞσϧͳͲ

    View full-size slide

  15. ϢχʔΫੑͷͳ͍σʔλ
    ྫɿ$(3FDUɺ3BOHFͳͲ
    4USVDUͰද͞ΕΔ͜ͱ͕ଟ͍

    View full-size slide

  16. Ϣχοτςετ
    Ͳ͏ॻ͖·͔͢ʁ

    View full-size slide

  17. wྫɿϘλϯΛԡͨ࣌͠ʹԻ͕࠶
    ੜ͞ΕΔ͜ͱ
    wϘλϯʹͲ͏ΞΫηε͢ΔʁΘ
    ͟Θ͟QVCMJDʹ͢ΔʁݏͰ͢Α
    Ͷʁ

    View full-size slide

  18. ؔ৺͝ͱͷ෼཭

    View full-size slide

  19. ؀ڥԻ࠶ੜϘλϯ
    ಄ग़͠Ϙλϯ
    ࠶ੜϘλϯ
    ఀࢭϘλϯ
    ΩϟϥΫλʔͷը૾

    View full-size slide

  20. ؀ڥԻ࠶ੜϘλϯ
    ಄ग़͠Ϙλϯ
    ࠶ੜϘλϯ
    ఀࢭϘλϯ
    ΩϟϥΫλʔͷը૾
    ؀ڥԻΛ࠶ੜ͢Δػೳ
    ԻָΛ಄ग़͢͠Δػೳ
    ԻָΛ࠶ੜ͢Δػೳ
    ԻָΛఀࢭ͢Δػೳ
    ΩϟϥΫλʔϞσϧ

    View full-size slide

  21. ؀ڥԻ࠶ੜϘλϯ
    ಄ग़͠Ϙλϯ
    ࠶ੜϘλϯ
    ఀࢭϘλϯ
    ΩϟϥΫλʔͷը૾
    ؀ڥԻΛ࠶ੜ͢Δػೳ
    ԻָΛ಄ग़͢͠Δػೳ
    ԻָΛ࠶ੜ͢Δػೳ
    ԻָΛఀࢭ͢Δػೳ
    ΩϟϥΫλʔϞσϧ
    6TF$BTF
    7JFX$POUSPMMFS

    View full-size slide

  22. 7JFX$POUSPMMFS

    View full-size slide

  23. 7JFX$POUSPMMFS
    VTF$BTFͷॲཧΛݺ
    Ϳ͚ͩ

    View full-size slide

  24. 6TF$BTF
    7JFXʹ·ͭΘΔ΋ͷ
    ͸ग़ͯ͜ͳ͍

    View full-size slide

  25. 6TF$BTF4QFD
    6TF$BTFͷςετ͕
    ॻ͚Δʂ

    View full-size slide

  26. 7JFX$POUSPMMFS
    ͱ
    6TF$BTFͷ઀ଓ

    View full-size slide

  27. ԡͨ͠Β
    ࠶ੜϘλϯͷݟͨ໨ʹ
    ͳͬͯ΄͘͠ͳ͍Ͱ͔͢ʁ

    View full-size slide

  28. Ͳ͏ॻ͖·͔͢ʁ

    View full-size slide

  29. wྫɿϘλϯΛԡͨ࣌͠ʹϘλϯͷΞΠ
    ίϯ͕Ұ࣌ఀࢭϚʔΫͳΒɺ࠶ੜΞΠ
    ίϯʹ੾Γସ͑Δɻ
    wJG CVUUPOJNBHFQBVTF*NBHF

    View full-size slide

  30. wྫɿϘλϯΛԡͨ࣌͠ʹϘλϯͷΞ
    Πίϯ͕Ұ࣌ఀࢭϚʔΫͳΒɺ࠶ੜ
    ΞΠίϯʹ੾Γସ͑Δɻ
    w❌ը໘ଆʹঢ়ଶΛ࣋ͬͯ͠·͏
    w❌Ի੠ͷ࠶ੜঢ়ଶͱ৯͍ҧ͏Մೳ
    ੑ͕͋Δ

    View full-size slide

  31. wྫɿ6TF$BTFʹ7JFX$POUSPMMFS
    ΁ͷࢀরΛ࣋ͨͤΔ
    wVTF$BTFTPNF7JFX$POUSPMMFS

    View full-size slide

  32. wྫɿ6TF$BTFʹ7JFX$POUSPMMFS΁ͷ
    ࢀরΛ࣋ͨͤΔ
    w❌ରͰີ݁߹ͳͷͰ࢖͍·Θͤͳ͍
    w❌ςετͷࡍʹ7JFX$POUSPMMFS͕ඞཁ

    View full-size slide

  33. ؀ڥԻ࠶ੜϘλϯ
    ಄ग़͠Ϙλϯ
    ࠶ੜϘλϯ
    ఀࢭϘλϯ
    ΩϟϥΫλʔͷը૾
    ؀ڥԻΛ࠶ੜ͢Δػೳ
    ԻָΛ಄ग़͢͠Δػೳ
    ԻָΛ࠶ੜ͢Δػೳ
    ԻָΛఀࢭ͢Δػೳ
    ΩϟϥΫλʔϞσϧ
    6TF$BTF
    7JFX$POUSPMMFS

    View full-size slide

  34. ؀ڥԻ࠶ੜϘλϯ
    ಄ग़͠Ϙλϯ
    ࠶ੜϘλϯ
    ఀࢭϘλϯ
    ΩϟϥΫλʔͷը૾
    ؀ڥԻΛ࠶ੜ͢Δػೳ
    ԻָΛ಄ग़͢͠Δػೳ
    ԻָΛ࠶ੜ͢Δػೳ
    ԻָΛఀࢭ͢Δػೳ
    ΩϟϥΫλʔϞσϧ
    6TF$BTF
    7JFX$POUSPMMFS
    ԻָΛ࠶ੜ͢Δɻ

    View full-size slide

  35. ؀ڥԻ࠶ੜϘλϯ
    ಄ग़͠Ϙλϯ
    ࠶ੜϘλϯ
    ఀࢭϘλϯ
    ΩϟϥΫλʔͷը૾
    ؀ڥԻΛ࠶ੜ͢Δػೳ
    ԻָΛ಄ग़͢͠Δػೳ
    ԻָΛ࠶ੜ͢Δػೳ
    ԻָΛఀࢭ͢Δػೳ
    ΩϟϥΫλʔϞσϧ
    6TF$BTF
    7JFX$POUSPMMFS
    ࠶ੜ͕׬ྃͨ͠ͷͰ
    7JFX$POUSPMMFS΁EFMFHBUF௨஌

    View full-size slide

  36. ؀ڥԻ࠶ੜϘλϯ
    ಄ग़͠Ϙλϯ
    ࠶ੜϘλϯ
    ఀࢭϘλϯ
    ΩϟϥΫλʔͷը૾
    ؀ڥԻΛ࠶ੜ͢Δػೳ
    ԻָΛ಄ग़͢͠Δػೳ
    ԻָΛ࠶ੜ͢Δػೳ
    ԻָΛఀࢭ͢Δػೳ
    ΩϟϥΫλʔϞσϧ
    6TF$BTF
    7JFX$POUSPMMFS
    ࠶ੜ͕׬ྃͨ͠EFMFHBUFΠϕϯτʹ
    ϘλϯΛҰ࣌ఀࢭͷΞΠίϯʹ͢Δ
    ͱॻ͍͓ͯ͘

    View full-size slide

  37. ͜ΕͬͯԿ͔ʹ
    ࣅͯΔ

    View full-size slide

  38. 6*7JFX$POUSPMMFS%FMFHBUF
    ը໘͕ಡΈࠐ·Εͨ࣌ɺ
    ը໘͕දࣔ͞ΕΑ͏ͱͨ࣌͠ɺ
    ը໘͕දࣔ͠ऴΘͬͨ͋ͱ

    View full-size slide

  39. ؀ڥԻ࠶ੜϘλϯ
    ಄ग़͠Ϙλϯ
    ࠶ੜϘλϯ
    ఀࢭϘλϯ
    ΩϟϥΫλʔͷը૾
    ؀ڥԻΛ࠶ੜ͢Δػೳ
    ԻָΛ಄ग़͢͠Δػೳ
    ԻָΛ࠶ੜ͢Δػೳ
    ԻָΛఀࢭ͢Δػೳ
    ΩϟϥΫλʔϞσϧ
    6TF$BTF
    7JFX$POUSPMMFS
    ը໘ͷදࣔΛߋ৽
    ॲཧΛ࣮ߦͯ͠௨஌

    View full-size slide

  40. 4XJGUͰͷ
    EFMFHBUFύλʔϯͷ
    σϝϦοτ

    View full-size slide

  41. 0QUJPOBMͳEFMFHBUFϝιου
    ͕༻ҙͰ͖ͳ͍

    View full-size slide

  42. !PCKDम০ࢠ

    View full-size slide

  43. !PCKDम০ࢠ
    1VSF4XJGU͡Όͳ͘ͳͬͪΌ͏ɻ
    (FOFSJDTɺ4USVDUɺ&OVN͕࢖͑
    ͳ͍ɾɾ

    View full-size slide

  44. Swift 2.0!!!

    View full-size slide

  45. QSPUPDPMFYUFOTJPO

    View full-size slide

  46. QSPUPDPMFYUFOTJPO
    σϑΥϧτͰԿ΋͠ͳ͍
    ˣ
    ࣮૷ͯ͠΋͠ͳͯ͘΋͍͍
    ˣ
    0QUJPOBM

    View full-size slide

  47. EFMFHBUF΋
    ࢖͍΍͘͢ͳͬͨʁ

    View full-size slide

  48. ͝੩ௌ͋Γ͕ͱ͏
    ͍͟͝·ͨ͠ɻ

    View full-size slide