Eight iOSを支えるアーキテクチャ / Architecture to support Eight iOS

13d936e697fe0f4fa96f926d0a712f6c?s=47 Sansan
June 15, 2019

Eight iOSを支えるアーキテクチャ / Architecture to support Eight iOS

■イベント
Developers Boost KANSAI
https://event.shoeisha.jp/devboost/20190615

■登壇概要
タイトル:
Eight iOSを支えるアーキテクチャ

登壇者:
Eight事業部 Engineering Group 河辺 雅史

▼Sansan Builders Box
https://buildersbox.corp-sansan.com/

13d936e697fe0f4fa96f926d0a712f6c?s=128

Sansan

June 15, 2019
Tweet

Transcript

  1. ɹ&JHIUJ04Λࢧ͑ΔΞʔΩςΫνϟ Տลխ࢙ 4BOTBOגࣜձࣾ

  2. Տลխ࢙ɹMasashi Kawabe Sansanגࣜձࣾ Eightࣄۀ෦ Engineering Group
 iOS ΤϯδχΞ 2018೥4݄ Sansanגࣜձࣾ৽ଔೖࣾ


    Eight iOS ͷ։ൃʹैࣄ
  3. 2018/04 2018/07 2018/12 2019/02 2019/04 2019/06 Sansanגࣜձࣾ ৽ଔೖࣾ / Eightࣄۀ෦഑ଐ

    ϝϯγϣϯػೳͷ࣮૷ Eight iOS v9.0.0 ϦϦʔε Sansanࣄۀ෦ҟಈ Sansan iOS v5.0.0 ϦϦʔε / Eightࣄۀ෦ҟಈ ೋஈ֊ೝূػೳͷ࣮૷
  4. 2018/04 2018/07 2018/12 2019/02 2019/04 2019/06 Sansanגࣜձࣾ ৽ଔೖࣾ / Eightࣄۀ෦഑ଐ

    ϝϯγϣϯػೳͷ࣮૷ Eight iOS v9.0.0 ϦϦʔε Sansanࣄۀ෦ҟಈ Sansan iOS v5.0.0 ϦϦʔε / Eightࣄۀ෦ҟಈ ೋஈ֊ೝূػೳͷ࣮૷
  5. None
  6. 2018/04 2018/07 2018/12 2019/02 2019/04 2019/06 Sansanגࣜձࣾ ৽ଔೖࣾ / Eightࣄۀ෦഑ଐ

    ϝϯγϣϯػೳͷ࣮૷ Eight iOS v9.0.0 ϦϦʔε Sansanࣄۀ෦ҟಈ Sansan iOS v5.0.0 ϦϦʔε / Eightࣄۀ෦ҟಈ ೋஈ֊ೝূػೳͷ࣮૷
  7. ϝϯγϣϯػೳͷ࣮૷ ओʹϝϯγϣϯͷදࣔɺΞϓϦىಈ࣌ʹදࣔ ͢Δػೳઆ໌ͷφϏήʔγϣϯ࣮૷Λ୲౰

  8. 2018/04 2018/07 2018/12 2019/02 2019/04 2019/06 Sansanגࣜձࣾ ৽ଔೖࣾ / Eightࣄۀ෦഑ଐ

    ϝϯγϣϯػೳͷ࣮૷ Eight iOS v9.0.0 ϦϦʔε Sansanࣄۀ෦ҟಈ Sansan iOS v5.0.0 ϦϦʔε / Eightࣄۀ෦ҟಈ ೋஈ֊ೝূػೳͷ࣮૷
  9. Eight iOS v9.0.0 ϦϦʔε ओʹձࣾϑΥϩʔҰཡը໘ɺձࣾϑΥϩʔɾ ΞϯϑΥϩʔػೳɺ͓஌Βͤը໘ɺϑΟʔυ UI ࡮৽ɺ UI Component

    ಋೖΛ୲౰
  10. 2018/04 2018/07 2018/12 2019/02 2019/04 2019/06 Sansanגࣜձࣾ ৽ଔೖࣾ / Eightࣄۀ෦഑ଐ

    ϝϯγϣϯػೳͷ࣮૷ Eight iOS v9.0.0 ϦϦʔε Sansanࣄۀ෦ҟಈ Sansan iOS v5.0.0 ϦϦʔε / Eightࣄۀ෦ҟಈ ೋஈ֊ೝূػೳͷ࣮૷
  11. Sansan iOS v5.0.0 ϦϦʔε ओʹ໊ࢗҰཡը໘ͷ࣮૷ɺ UI Component
 ಋೖΛ୲౰

  12. 2018/04 2018/07 2018/12 2019/02 2019/04 2019/06 Sansanגࣜձࣾ ৽ଔೖࣾ / Eightࣄۀ෦഑ଐ

    ϝϯγϣϯػೳͷ࣮૷ Eight iOS v9.0.0 ϦϦʔε Sansanࣄۀ෦ҟಈ Sansan iOS v5.0.0 ϦϦʔε / Eightࣄۀ෦ҟಈ ೋஈ֊ೝূػೳͷ࣮૷
  13. ໊ࢗࡱӨ ࿈བྷઌҰཡ ϑΟʔυ ϓϨϛΞϜػೳ

  14. ໊ࢗࡱӨ ࿈བྷઌҰཡ ϑΟʔυ ϓϨϛΞϜػೳ ը໘ʹ൓ө͢Δঢ়ଶ͕ଟ͘ෳࡶ

  15. ઃܭͱ͸ʁ ؔ৺ͷ෼཭ʹΑͬͯɺෳࡶͳ໰୊Λ
 ୯७ͳ໰୊ͷ܈ͱͯ͠੾Γ෼͚Δ͜ͱ Ҿ༻J04ΞϓϦઃܭύλʔϯೖ໳
 IUUQTQFBLTDDCPPLTJ04@BSDIJUFDUVSF

  16. αʔόʔ͔ΒϑΥϩʔ͍ͯ͠Δਓ෺ϦετΛऔಘͯ͠ɺ ਓ෺৘ใΛ࣋ͭ Entity ʹ parse ͯ͠ɺΩϟογϡʹ औಘͨ͠৘ใΛอଘͯ͠ɺ View ʹදࣔ͢Δ

  17. αʔόʔ͔ΒϑΥϩʔ͍ͯ͠Δਓ෺ϦετΛऔಘͯ͠ɺ ਓ෺৘ใΛ࣋ͭ Entity ʹ parse ͯ͠ɺΩϟογϡʹ औಘͨ͠৘ใΛอଘͯ͠ɺ View ʹදࣔ͢Δ ෳࡶ

  18. ௨৴͍ͨ͠
 αʔόʔ͔ΒϑΥϩʔ͍ͯ͠Δਓ෺ϦετΛऔಘͯ͠ɺ ਓ෺৘ใΛ࣋ͭ Entity ʹ parse ͯ͠ɺΩϟογϡʹ औಘͨ͠৘ใΛอଘͯ͠ɺ View ʹදࣔ͢Δ

  19. σʔλΛ૊Έཱ͍ͯͨ
 αʔόʔ͔ΒϑΥϩʔ͍ͯ͠Δਓ෺ϦετΛऔಘͯ͠ɺ ਓ෺৘ใΛ࣋ͭ Entity ʹ parse ͯ͠ɺΩϟογϡʹ औಘͨ͠৘ใΛอଘͯ͠ɺ View ʹදࣔ͢Δ

  20. σʔλΛอଘ͍ͨ͠
 αʔόʔ͔ΒϑΥϩʔ͍ͯ͠Δਓ෺ϦετΛऔಘͯ͠ɺ ਓ෺৘ใΛ࣋ͭ Entity ʹ parse ͯ͠ɺΩϟογϡʹ औಘͨ͠৘ใΛอଘͯ͠ɺ View ʹදࣔ͢Δ

  21. ϨΠΞ΢τ͍ͨ͠
 αʔόʔ͔ΒϑΥϩʔ͍ͯ͠Δਓ෺ϦετΛऔಘͯ͠ɺ ਓ෺৘ใΛ࣋ͭ Entity ʹ parse ͯ͠ɺΩϟογϡʹ औಘͨ͠৘ใΛอଘͯ͠ɺ View ʹදࣔ͢Δ

  22. ௨৴͍ͨ͠
 αʔόʔ͔ΒϑΥϩʔ͍ͯ͠Δਓ෺ϦετΛऔಘͯ͠ σʔλΛ૊Έཱ͍ͯͨ
 ਓ෺৘ใΛ࣋ͭ Entity ʹ parse ͢Δ σʔλΛอଘ͍ͨ͠
 Ωϟογϡʹऔಘͨ͠৘ใΛอଘ͢Δ

    ϨΠΞ΢τ͍ͨ͠
 View ʹදࣔ͢Δ
  23. ઃܭΛ͢Δࡍʹ໾ཱͭͷ͕ઃܭύλʔϯ
 ༗໊ͳͷ͸ɺ GoF ͷ 23ݸͷσβΠϯύλʔϯ

  24. ઃܭύλʔϯΛ஌ΔϝϦοτ - ࠶ར༻ੑͷߴ͍ॊೈͳઃܭ͕Ͱ͖Δ - ։ൃऀؒͷҙࢥૄ௨͕༰қʹͳΔ https://www.techscore.com/tech/DesignPattern/foundation/foundation1.html/#dp0-3 YYYύλʔϯͰ͢

  25. ΞʔΩςΫνϟ΋ύλʔϯ - ΞϓϦΛಈ͔͢ͱ͍͏ෳࡶͳ໰୊͸ɺେ·͔ͳෳ਺ͷ૚ʢ୯७ͳ໰୊ʣʹ
 ੾Γ෼͚ΒΕΔ - ͦ͜Ͱ׆༻͞ΕΔͷ͕ΞʔΩςΫνϟ - Eight iOS Ͱ͸

    MVVM ύλʔϯΛ࠾༻
  26. ͳͥ MVVM Λ࠾༻ʁ αʔϏεͷॳظஈ֊͸໊ࢗ؅ཧΞϓϦͩͬͨͨΊɺ MVC Ͱ
 ྑ͔͔ͬͨ΋͠Εͳ͍

  27. ͳͥ MVVM Λ࠾༻ʁ - αʔϏε͕੒௕͢ΔʹͭΕͯɺSNS ػೳͷΑ͏ͳ
 ಈతʹঢ়ଶ͕มΘΔ΋ͷ͕૿͖͑ͯͨ - ඇಉظॲཧΛந৅Խ͢ΔͨΊʹར༻͍ͯ͠Δ
 RxSwift

    ͷ binding ػߏΛ࠷େݶʹ׆͔͢͜ͱ͕
 Ͱ͖Δ
  28. MVVM ύλʔϯ 7JFX 7JFX$POUSPMMFS 7JFX.PEFM .PEFM 6*&WFOUT 3FRVFTUT %BUB %BUB#JEJOH

    "QQMF͕ఏڙ͢Δ6*,JUʹ͸6*7JFX$POUSPMMFSͱ͍͏7JFXΛ؅ཧ͢ΔΫϥε͕͋Γɺ
 ը໘ͷϥΠϑαΠΫϧͱը໘ભҠΛ୲͏
  29. MVVM ύλʔϯ 7JFX 7JFX$POUSPMMFS 7JFX.PEFM .PEFM 6*&WFOUT 3FRVFTUT %BUB %BUB#JEJOH

  30. MVVM ύλʔϯ 7JFX 7JFX$POUSPMMFS 7JFX.PEFM .PEFM 6*&WFOUT 3FRVFTUT %BUB %BUB#JEJOH

  31. MVVM ύλʔϯ 7JFX 7JFX$POUSPMMFS 7JFX.PEFM .PEFM 6*&WFOUT 3FRVFTUT %BUB %BUB#JEJOH

  32. MVVM ύλʔϯ 7JFX 7JFX$POUSPMMFS 7JFX.PEFM .PEFM 6*&WFOUT 3FRVFTUT %BUB %BUB#JEJOH

  33. MVVM ύλʔϯ 7JFX 7JFX$POUSPMMFS 7JFX.PEFM .PEFM 6*&WFOUT 3FRVFTUT %BUB %BUB#JEJOH

  34. 7JFX - " ͢΂͖͜ͱ - UI Λఆٛ͢Δ - ViewModel ʹ

    UI Events Λ఻͑Δ - ViewModel ͔Βड͚औͬͨσʔλΛ൓ө͢Δ - # ͢΂͖Ͱͳ͍͜ͱ - ϓϨθϯςʔγϣϯϩδοΫΛఆٛ͢Δ - ௨৴΍σʔλૢ࡞Λߦ͏
  35. MVVM ύλʔϯ 7JFX 7JFX$POUSPMMFS 7JFX.PEFM .PEFM 6*&WFOUT 3FRVFTUT %BUB %BUB#JEJOH

  36. 7JFX.PEFM - " ͢΂͖͜ͱ - UI Events Λ؂ࢹ͠ɺModel ʹॲཧΛґཔ͢Δ -

    Model ͔Βड͚औͬͨσʔλΛ View Ͱར༻͢Δͷʹ
 ࠷దͳܗʹՃ޻͢Δ - # ͢΂͖Ͱͳ͍͜ͱ - UI Λఆٛ͢Δ - ௨৴΍σʔλૢ࡞Λߦ͏
  37. MVVM ύλʔϯ 7JFX 7JFX$POUSPMMFS 7JFX.PEFM .PEFM 6*&WFOUT 3FRVFTUT %BUB %BUB#JEJOH

  38. .PEFM - " ͢΂͖͜ͱ - σʔλߏ଄Λఆٛ͢Δ - σʔλΛӬଓԽ͢Δ - σʔλΛૢ࡞͢Δ

    - # ͢΂͖Ͱͳ͍͜ͱ - UI Λఆٛ͢Δ - σʔλΛ View Ͱར༻͢Δͷʹ࠷దͳܗʹՃ޻͢Δ
  39. MVVM ύλʔϯ 7JFX 7JFX$POUSPMMFS 7JFX.PEFM .PEFM 6*&WFOUT 3FRVFTUT %BUB %BUB#JEJOH

  40. 7JFX 7JFX$POUSPMMFS 7JFX.PEFM 6*&WFOUT 3FRVFTUT %BUB %BUB#JEJOH .PEFM &OUJUZ 3FQPTJUPSZ

    3FRVFTU 6TF$BTF .PEFM
  41. - Entity - σʔλߏ଄Λఆٛ͢Δߏ଄ମ - Repository - Entity ͷ CRUD

    ૢ࡞Λఏڙ͢Δ - SQLite ΍ UserDefaults ౳ͷ DataSource ΛӅṭ - Request - HTTP Request Λ౤͛ΔॲཧΛఆٛ͢Δ - UseCase - ϏδωεϩδοΫΛهड़͢Δ
  42. 7JFX 7JFX$POUSPMMFS 3RVFTUT %BUB 6*&WFOUT %BUB#JEJOH 7JFX.PEFM 6TF$BTF 3FRVFTU 3FQPTJUPSZ

    &OUJUZ 3FRVFTU 3FTQPOTF $36% %BUB 3FTVMU ,OPXTBCPVU ,OPXTBCPVU
  43. ௨৴͍ͨ͠
 αʔόʔ͔ΒϑΥϩʔ͍ͯ͠Δਓ෺ϦετΛऔಘͯ͠ σʔλΛ૊Έཱ͍ͯͨ
 ਓ෺৘ใΛ࣋ͭ Entity ʹ parse ͢Δ σʔλΛอଘ͍ͨ͠
 Ωϟογϡʹऔಘͨ͠৘ใΛอଘ͢Δ

    ϨΠΞ΢τ͍ͨ͠
 View ʹදࣔ͢Δ
  44. ௨৴͍ͨ͠
 αʔόʔ͔ΒϑΥϩʔ͍ͯ͠Δਓ෺ϦετΛऔಘͯ͠ σʔλΛ૊Έཱ͍ͯͨ
 ਓ෺৘ใΛ࣋ͭ Entity ʹ parse ͢Δ σʔλΛอଘ͍ͨ͠
 Ωϟογϡʹऔಘͨ͠৘ใΛอଘ͢Δ

    ϨΠΞ΢τ͍ͨ͠
 View ʹදࣔ͢Δ ίʔυΛݟͯΈ·͠ΐ͏$ ⚠આ໌ͷͨΊʹίʔυ͸؆ུԽ͍ͯ͠·͢
  45. 7JFX 7JFX$POUSPMMFS 3RVFTUT %BUB 6*&WFOUT %BUB#JEJOH 7JFX.PEFM 6TF$BTF 3FRVFTU 3FQPTJUPSZ

    &OUJUZ 3FRVFTU 3FTQPOTF $36% %BUB 3FTVMU ,OPXTBCPVU ,OPXTBCPVU
  46. Entity ߏ଄ମͰσʔλΛఆٛ

  47. 7JFX 7JFX$POUSPMMFS 3RVFTUT %BUB 6*&WFOUT %BUB#JEJOH 7JFX.PEFM 6TF$BTF 3FRVFTU 3FQPTJUPSZ

    &OUJUZ 3FRVFTU 3FTQPOTF $36% %BUB 3FTVMU ,OPXTBCPVU ,OPXTBCPVU
  48. Request 3FTQPOTFͷܕΛఆٛ

  49. Request )551.FUIPEΛఆٛ

  50. Request )551.FUIPEΛ౤͛Δ1BUIΛఆٛ

  51. Request 3FTQPOTFΛड͚औͬͨࡍͷॲཧΛఆٛ

  52. 7JFX 7JFX$POUSPMMFS 3RVFTUT %BUB 6*&WFOUT %BUB#JEJOH 7JFX.PEFM 6TF$BTF 3FRVFTU 3FQPTJUPSZ

    &OUJUZ 3FRVFTU 3FTQPOTF $36% %BUB 3FTVMU ,OPXTBCPVU ,OPXTBCPVU
  53. Repository 1SPUPDPM *OUFSGBDF Ͱ$36%ૢ࡞Λఆٛ

  54. Repository ఆٛͨ͠$36%ૢ࡞Λ࣮૷

  55. 7JFX 7JFX$POUSPMMFS 3RVFTUT %BUB 6*&WFOUT %BUB#JEJOH 7JFX.PEFM 6TF$BTF 3FRVFTU 3FQPTJUPSZ

    &OUJUZ 3FRVFTU 3FTQPOTF $36% %BUB 3FTVMU ,OPXTBCPVU ,OPXTBCPVU
  56. UseCase ۩ମܕͰ͸ͳ͘ந৅ʹґଘ
 *OJUJBMJ[FSͰґଘੑʢඞཁͳ΋ͷʣΛ஫ೖ

  57. UseCase - ґଘؔ܎ٯసͷݪଇΛద༻ - มԽ͠΍͍͢۩৅Ͱ͸ͳ͘ɺ҆ఆͨ͠ந৅ʹґଘ - Dependency Injection Λద༻ -

    Ϋϥεͷ֎͔Βґଘ͍ͯ͠Δ෺Λ஫ೖ - ந৅ʹґଘ͠ɺΫϥεͷ֎͔Βඞཁͳ΋ͷΛ஫ೖ͢Δ͜ͱͰςελϒϧʹ
  58. UseCase ϏδωεϩδοΫΛ࣮૷

  59. 7JFX 7JFX$POUSPMMFS 3RVFTUT %BUB 6*&WFOUT %BUB#JEJOH 7JFX.PEFM 6TF$BTF 3FRVFTU 3FQPTJUPSZ

    &OUJUZ 3FRVFTU 3FTQPOTF $36% %BUB 3FTVMU ,OPXTBCPVU ,OPXTBCPVU
  60. ViewModel 7JFXͰදࣔ͢Δ&OUJUZΛެ։

  61. ViewModel 7JFX͔Β6*&WFOUΛऔಘ

  62. ViewModel .PEFMʹॲཧΛґཔ

  63. 7JFX 7JFX$POUSPMMFS 3RVFTUT %BUB 6*&WFOUT %BUB#JEJOH 7JFX.PEFM 6TF$BTF 3FRVFTU 3FQPTJUPSZ

    &OUJUZ 3FRVFTU 3FTQPOTF $36% %BUB 3FTVMU ,OPXTBCPVU ,OPXTBCPVU
  64. View ը໘ىಈͷΠϕϯτΛ௨஌

  65. View 7JFX.PEFMʹΠϕϯτΛ఻͑Δ

  66. View 7JFX.PEFM͔Βड͚औͬͨ
 σʔλΛ൓ө

  67. 7JFX 7JFX$POUSPMMFS 3RVFTUT %BUB 6*&WFOUT %BUB#JEJOH 7JFX.PEFM 6TF$BTF 3FRVFTU 3FQPTJUPSZ

    &OUJUZ 3FRVFTU 3FTQPOTF $36% %BUB 3FTVMU ,OPXTBCPVU ,OPXTBCPVU
  68. ·ͱΊ - Eight iOS Ͱ͸ MVVM ύλʔϯΛ࠾༻ - ֤૚ͷ͢΂͖͜ͱɾ͢΂͖Ͱͳ͍͜ͱΛҙ࣮ࣝͯ͠૷ -

    มԽ͠΍͍͢۩৅΁ͷґଘ͸ආ͚ɺந৅΁ґଘ
  69. None
  70. None