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

実践!「みてね」における自動生成活用例

shunsuke sato
September 21, 2020

 実践!「みてね」における自動生成活用例

shunsuke sato

September 21, 2020
Tweet

More Decks by shunsuke sato

Other Decks in Programming

Transcript

  1. ࣮ફʂʮΈͯͶʯʹ͓͚Δࣗಈੜ੒׆༻ྫ
    !J04%$+BQBO

    View full-size slide

  2. ࣗݾ঺հ
    • ໊લ: ࠤ౻ढ़ี
    • TwitterͳͲ: @ushisantoasobu
    • ॴଐ: ʢגʣϛΫγΟ ΈͯͶࣄۀ෦
    • ։ൃ: iOSΛϝΠϯʹɺAndroid / Rails ͳͲ
    • झຯ: αοΧʔʢϑοταϧʣͱ ίʔώʔ

    View full-size slide

  3. ʮΈͯͶʯͱ͸ʁ
    • ʮՈ଒ΞϧόϜ ΈͯͶʯʢ ւ֎Ͱ͸ʮFamilyAlbumʯʣ
    • ࢠڙͷࣸਅ΍ಈըΛɺՈ଒಺Ͱڞ༗͢ΔΞϓϦ
    • ΈͯͶͷiOSΞϓϦʹ͍ͭͯ
    • ։ൃ։͔࢝Β7೥໨
    • ʮεϐʔυ༏ઌ < ಺෦తͳ࣭ʯͳ։ൃϑΣʔζ

    View full-size slide

  4. ΞδΣϯμ
    • ʮࣗಈੜ੒ʯʹڵຯΛ͖͔͚࣋ͬͨͬ
    • ͜ͷτʔΫͰѻ͏ʮࣗಈੜ੒ʯͱ͸
    • ΈͯͶʹ͓͚Δࣗಈੜ੒׆༻ྫ 3ͭ
    • Sourcery / Stencil ͷجຊతͳ࿩
    • Sourcery / Stencil ͷTIPS
    • ࣗಈੜ੒Λ1೥ӡ༻ͯ͠Έͯͷॴײ
    • ·ͱΊ

    View full-size slide

  5. ʮࣗಈੜ੒ʯʹڵຯΛ͖͔͚࣋ͬͨͬ
    IUUQTXXXZPVUVCFDPNXBUDI W5LHG0C6

    View full-size slide

  6. ʮࣗಈੜ੒ʯʹڵຯΛ͖͔͚࣋ͬͨͬ
    • UIKonf 2019 ͰͷUberͷΤϯδχΞͷํʹΑΔࣗಈੜ੒ʢ”Mockolo”ʣʹ͍ͭͯͷൃද
    • UberͰ͸શͯͷϓϩμΫτͰܭ230ສߦ΄Ͳͷίʔυϕʔε
    • ͦͷ͏ͪ൒෼͸ʮࣗಈੜ੒ʯ͞Εͨ΋ͷ

    View full-size slide

  7. ʮࣗಈੜ੒ʯʹڵຯΛ͖͔͚࣋ͬͨͬ

    • UIKonf 2019 ͰͷUberͷΤϯδχΞͷํʹΑΔࣗಈੜ੒ʢ”Mockolo”ʣʹ͍ͭͯͷൃද
    • UberͰ͸શͯͷϓϩμΫτͰܭ230ສߦ΄Ͳͷίʔυϕʔε
    • ͦͷ͏ͪ൒෼͸ʮࣗಈੜ੒ʯ͞Εͨ΋ͷ

    View full-size slide

  8. ͜ͷτʔΫͰѻ͏ʮࣗಈੜ੒ʯͱ͸
    • Ϧιʔε·ΘΓΛλΠϓηʔϑͳSwiftͷίʔυͱͯࣗ͠ಈੜ੒͢Δ΋ͷ
    • RSwift, SwiftGenͳͲ
    • ίʔυΛॻ͖͸͡ΊΔ͏͑ͰͷςϯϓϨʔτࣗಈੜ੒
    • ෳࡶͳΞʔΩςΫνϟͷಋೖ͕ҰൠతʹͳΔʹͭΕɺधཁ͕ߴ·͍ͬͯΔʁ
    • ʮ͋ΔίʔυΛ΋ͱʹɺผͷίʔυΛੜ੒͢Δʯʢϝλϓϩάϥϛϯάʣ
    • Sourcery / Stencil ͳͲΛར༻͢Δ

    View full-size slide

  9. • Ϧιʔε·ΘΓΛλΠϓηʔϑͳSwiftͷίʔυͱͯࣗ͠ಈੜ੒͢Δ΋ͷ
    • RSwift, SwiftGenͳͲ
    • ίʔυΛॻ͖͸͡ΊΔ͏͑ͰͷςϯϓϨʔτࣗಈੜ੒
    • ෳࡶͳΞʔΩςΫνϟͷಋೖ͕ҰൠతʹͳΔʹͭΕɺधཁ͕ߴ·͍ͬͯΔʁ
    • ʮ͋ΔίʔυΛ΋ͱʹɺผͷίʔυΛੜ੒͢Δʯʢϝλϓϩάϥϛϯάʣ
    • Sourcery / Stencil ͳͲΛར༻͢Δ
    ͜ͷτʔΫͰѻ͏ʮࣗಈੜ੒ʯͱ͸

    View full-size slide

  10. ΈͯͶʹ͓͚Δࣗಈੜ੒׆༻ྫͭ
    • 1. ʮελϒ͕ฦ͢஋ʯͷศརϏϧμʔϝιου
    • 2. DIͷґଘؔ܎ղܾ
    • 3. ϞοΫ

    View full-size slide

  11. ʮελϒ͕ฦ͢஋ʯͷศརϏϧμʔϝιου
    • [લఏ]
    • ΈͯͶͰ͸GUIΞʔΩςΫνϟʹMVPΛ࠾༻͍ͯ͠Δ
    • ςετΛॻ͍͍ͯΔ

    View full-size slide

  12. ͜ͷΑ͏ͳQSFTFOUFSͷςετΛॻ͍͍ͯΔ
    ʮελϒ͕ฦ͢஋ʯͷศརϏϧμʔϝιου

    View full-size slide

  13. ελϒ͕ฦ͢஋Ληοτ͢Δ
    ʮελϒ͕ฦ͢஋ʯͷศརϏϧμʔϝιου

    View full-size slide

  14. ςετର৅ͷϝιουΛ࣮ߦ
    ʮελϒ͕ฦ͢஋ʯͷศརϏϧμʔϝιου

    View full-size slide

  15. ϞοΫʢzWJFXzʣ͕ਖ਼͍͠ڍಈΛ͍ͯ͠Δ͜ͱΛ֬ೝ͢Δ
    ʮελϒ͕ฦ͢஋ʯͷศརϏϧμʔϝιου

    View full-size slide

  16. ʮελϒ͕ฦ͢஋ʯͱ͸ʁ
    ʮελϒ͕ฦ͢஋ʯͷศརϏϧμʔϝιου

    View full-size slide

  17. ʮελϒ͕ฦ͢஋ʯͷศརϏϧμʔϝιου

    View full-size slide

  18. ͜͜Λॻ͘ͷ͕खؒͱ͍͏՝୊͕νʔϜ಺Ͱ͋ͬͨ
    ʮελϒ͕ฦ͢஋ʯͷศརϏϧμʔϝιου

    View full-size slide

  19. "TTFSU͍ͯ͠Δͷ͸zJEz͚ͩ
    ʮελϒ͕ฦ͢஋ʯͷศརϏϧμʔϝιου

    View full-size slide

  20. ֤Entityʹରͯ͠
    ʮͦΕͧΕͷܕʹରԠͨ͠”ͦΕΆ͍”σϑΥϧτҾ਺Λ࣋ͭϏϧμʔϝιουʯΛ
    ςετλʔήοτʹextensionͱͯࣗ͠ಈੜ੒͢Δ
    ͱ͍͏ΞΠσΞΛࢥ͍ͭ͘
    ʮελϒ͕ฦ͢஋ʯͷศརϏϧμʔϝιου

    View full-size slide

  21. ͜ͷΑ͏ͳ&OUJUZʹରͯ͠
    ʮελϒ͕ฦ͢஋ʯͷศརϏϧμʔϝιου

    View full-size slide

  22. ͜ͷΑ͏ͳ΋ͷϏϧμʔϝιουΛࣗಈੜ੒͢Δ
    ʮελϒ͕ฦ͢஋ʯͷศརϏϧμʔϝιου

    View full-size slide

  23. ʮͦΕͧΕͷܕʹରԠͨ͠zͦΕΆ͍zσϑΥϧτҾ਺Λ࣋ͭϏϧμʔϝιουʯ
    ʮελϒ͕ฦ͢஋ʯͷศརϏϧμʔϝιου

    View full-size slide

  24. ͖͞΄Ͳͷςετ͕͜ͷΑ͏ʹεοΩϦॻ͚Δ
    ʮελϒ͕ฦ͢஋ʯͷศརϏϧμʔϝιου

    View full-size slide

  25. %*ͷґଘؔ܎ղܾ
    • [લఏ]
    • γεςϜΞʔΩςΫνϟʹCleanArchitectureΛ࠾༻͍ͯ͠Δ
    • ґଘ͢Δ΋ͷ͸DI͍ͯ͠Δ
    • ґଘؔ܎ղܾͷॲཧ͸ɺखͰΰϦΰϦॻ͍͍ͯͨ
    • ʢҎલ͸αʔυύʔςΟͷϥΠϰϥϦΛར༻͍ͯͨ͠ɻ͜͜Β΁ΜͷܦҢʹ͍ͭͯ͸ޙड़ʣ

    View full-size slide

  26. IUUQTTQFBLFSEFDLDPNKTTF[IPXUPNBOBHFEJXJUIPVUVTJOHFYUFSOBMMJCSBSZJOTXJGU
    %*ͷґଘؔ܎ղܾ

    View full-size slide

  27. ͜ͷΑ͏ͳґଘؔ܎ղܾͷίʔυΛɺ͜Ε·Ͱ͸ʮखͰΰϦΰϦॻ͍͍ͯͨʯ͕
    ࠓ͸ʮࣗಈੜ੒ʯ͞ΕΔΑ͏ʹͳͬͨ
    %*ͷґଘؔ܎ղܾ

    View full-size slide

  28. ͦΕͧΕ%*͢Δ΋ͷʢϓϩτίϧʣʹରͯ͠
    %*ͷґଘؔ܎ղܾ

    View full-size slide

  29. ͦͷ࣮ମΛฦ͢ϑΝΫτϦʔϝιου
    %*ͷґଘؔ܎ղܾ

    View full-size slide

  30. ϞοΫ
    • [લఏ]
    • DIಉ༷ɺϞοΫ͸ʮखͰΰϦΰϦʯॻ͍͍͔ͯͨ

    ”SwiftMockGeneratorForXcode”ʢXcode extensionʣΛར༻͍ͯͨ͠

    View full-size slide

  31. 4XJGU.PDL(FOFSBUPS'PS9DPEFͱಉ͡Α͏ͳ*'ͷ΋ͷΛࣗಈੜ੒ͯ͠Έͨ
    ϞοΫ

    View full-size slide

  32. • ʢ͜ͷτʔΫ͕࠾୒͞Ε͔ͯΒɺSourcery / Stencil ͷ෮श͕ͯΒ΍ͬͯΈͨʣ
    • -> ·ͩӡ༻࢝͠Ίͨ͹͔Γ
    • ϞοΫͷࣗಈੜ੒ΛͪΌΜͱ΍Ζ͏ͱࢥͬͨΒ݁ߏ೉͔ͬͨ͠
    • ʮࣗಈੜ੒ΛͲ͜·Ͱ΍Γ͖Δ͔ʯ͸ॏཁͳϙΠϯτͱೝࣝɻޙड़͢Δ
    ϞοΫ

    View full-size slide

  33. ΈͯͶʹ͓͚Δࣗಈੜ੒׆༻ྫσϞΞϓϦ

    https://github.com/ushisantoasobu/iosdc-2020-demo

    View full-size slide

  34. Sourcery / Stencil ͷجຊతͳઆ໌

    View full-size slide

  35. 4PVSDFSZͬͯͦ΋ͦ΋Կʁ
    • SwiftͰʮ͋Δίʔυ͔ΒɺผͷίʔυΛੜ੒͢ΔʯʢϝλϓϩάϥϛϯάʣͨΊͷϥΠϒϥϦ
    • https://github.com/krzysztofzablocki/Sourcery
    • ʮ͋Δίʔυ͔ΒɺผͷίʔυΛੜ੒͢Δʯ= ҎԼͷ2ͭͷϥΠϒϥϦʹґଘ͍ͯ͠Δ
    • ίʔυͷղੳ -> SourceKittenʢSourceKitʣ
    • ςϯϓϨʔτΤϯδϯ -> Stencil

    View full-size slide

  36. 4UFODJMͬͯͦ΋ͦ΋Կʁ
    • ςϯϓϨʔτΤϯδϯ
    • https://github.com/stencilproject/Stencil
    • ʢREADMEΑΓʣSwiftGen, Kitura, Weaver, Genesis ͳͲͰར༻͞Ε͍͍ͯΔ
    • Variables / Filters / Tags ʢҎ߱ͷϖʔδͰઆ໌ʣ

    View full-size slide

  37. 4UFODJMͬͯͦ΋ͦ΋Կʁ
    ςϯϓϨʔτϑΝΠϧͷݟͨ໨͸͜Μͳײ͡

    View full-size slide

  38. 4UFODJMͬͯͦ΋ͦ΋Կʁ
    7BSJBCMFTදࣔ͢Δม਺

    View full-size slide

  39. 4UFODJMͬͯͦ΋ͦ΋Կʁ
    5BHTGPS΍JGͳͲͷ੍ޚߏจ

    View full-size slide

  40. 4UFODJMͬͯͦ΋ͦ΋Կʁ
    'JMUFSTม਺Λʮม׵͢Δʯ΋ͷ

    View full-size slide

  41. 4PVSDFSZ4UFODJMΛ࢖ͬͨࣗಈੜ੒ͷୈҰา

    View full-size slide

  42. XcodeͰϓϩδΣΫτ࡞ͬͯɺSourcery͸ΠϯετʔϧࡁΈͷͱ͜Ζ͔Βελʔτ
    ʢΠϯετʔϧʹ͍ͭͯ͸লུɻ͜͜Ͱ͸cocoapodsͰΠϯετʔϧʣ
    4PVSDFSZ4UFODJMΛ࢖ͬͨࣗಈੜ੒ͷୈҰา

    View full-size slide

  43. l)PHFzl'VHBzͱ͍͏໊લͷͭͷTUSVDU͕ɺz&OUJUZzσΟϨΫτϦʹ͋Δͱ͢Δ
    4PVSDFSZ4UFODJMΛ࢖ͬͨࣗಈੜ੒ͷୈҰา

    View full-size slide

  44. ͜ͷΑ͏ͳςϯϓϨʔτʢTUFODJMϑΝΠϧʣΛॻ͍ͯΈΔ
    4PVSDFSZ4UFODJMΛ࢖ͬͨࣗಈੜ੒ͷୈҰา

    View full-size slide

  45. શͯͷzTUSVDUzʹରͯ͠GPSϧʔϓΛճ͢
    4PVSDFSZ4UFODJMΛ࢖ͬͨࣗಈੜ੒ͷୈҰา

    View full-size slide

  46. zTUSVDUzͷ໊લΛग़ྗ͢Δ
    4PVSDFSZ4UFODJMΛ࢖ͬͨࣗಈੜ੒ͷୈҰา

    View full-size slide

  47. TPVSDFSZίϚϯυΛ࣮ߦ͢Δ
    4PVSDFSZ4UFODJMΛ࢖ͬͨࣗಈੜ੒ͷୈҰา

    View full-size slide

  48. lTPVSDFTzҾ਺͸ࣗಈੜ੒ର৅ϑΝΠϧؚ͕·ΕΔσΟϨΫτϦΛࢦఆ
    4PVSDFSZ4UFODJMΛ࢖ͬͨࣗಈੜ੒ͷୈҰา

    View full-size slide

  49. lUFNQMBUFTzҾ਺͸ςϯϓϨʔτϑΝΠϧΛࢦఆ
    4PVSDFSZ4UFODJMΛ࢖ͬͨࣗಈੜ੒ͷୈҰา

    View full-size slide

  50. lPVUQVUzҾ਺Ͱࣗಈੜ੒͢ΔϑΝΠϧͷग़ྗઌΛࢦఆ
    4PVSDFSZ4UFODJMΛ࢖ͬͨࣗಈੜ੒ͷୈҰา

    View full-size slide

  51. ͦΕͧΕͷTUSVDUͷ໊લ͕ग़ྗ͞ΕͨϑΝΠϧ͕ࣗಈੜ੒͞Εͨ
    4PVSDFSZ4UFODJMΛ࢖ͬͨࣗಈੜ੒ͷୈҰา

    View full-size slide

  52. ʮʮελϒ͕ฦ͢஋ʯͷศརʙʯͷςϯϓϨʔτΛோΊͯΈΔ

    View full-size slide

  53. ͜ͷΑ͏ͳ΋ͷΛࣗಈੜ੒͢Δʹ͸ͲͷΑ͏ͳςϯϓϨʔτϑΝΠϧΛॻ͘ඞཁ͕͋Δʁ
    ʮʮελϒ͕ฦ͢஋ʯͷศརʙʯͷςϯϓϨʔτΛோΊͯΈΔ

    View full-size slide

  54. ʮʮελϒ͕ฦ͢஋ʯͷศརʙʯͷςϯϓϨʔτΛோΊͯΈΔ

    View full-size slide

  55. શͯͷTUSVDUΛGPSϧʔϓͰճͯ͠ɺϏϧμʔϝιουΛੜ΍͢ʢ͜͜Β΁Μ͸ൺֱతγϯϓϧͳͷͰলུʣ
    ʮʮελϒ͕ฦ͢஋ʯͷศརʙʯͷςϯϓϨʔτΛோΊͯΈΔ

    View full-size slide

  56. ʮʮελϒ͕ฦ͢஋ʯͷศརʙʯͷςϯϓϨʔτΛோΊͯΈΔ

    View full-size slide

  57. TUSVDUͷશͯͷม਺ͰGPSϧʔϓͰճ͢
    ʮʮελϒ͕ฦ͢஋ʯͷศརʙʯͷςϯϓϨʔτΛோΊͯΈΔ

    View full-size slide

  58. ΦϓγϣφϧͳΒσϑΥϧτҾ਺ͷ஋ΛzOJMzͱग़ྗ͢Δ
    ʮʮελϒ͕ฦ͢஋ʯͷศརʙʯͷςϯϓϨʔτΛோΊͯΈΔ

    View full-size slide

  59. Ұൠతͳܕʹ͍ͭͯ͸ɺͦΕͧΕʹରԠͨ͠ʮͦΕΆ͍ʯ஋ΛσϑΥϧτҾ਺ͷ஋ͱͯ͠ग़ྗ͢Δ
    ʮʮελϒ͕ฦ͢஋ʯͷศརʙʯͷςϯϓϨʔτΛோΊͯΈΔ

    View full-size slide

  60. &OVNʹ͍ͭͯ͸࠷ॳͷ஋ΛσϑΥϧτҾ਺ͷ஋ͱͯ͠ग़ྗ͢Δɻ
    ͨͩ͠"TTPDJBUFE7BMVFΛ΋ͭ஋ʹରͯ͠͸͏·ࣗ͘ಈੜ੒͢Δͷ͕೉͔ͬͨ͠ͷͰɺ࣍ͷʮ௚ॻ͖ʯͰճආ͢ΔΑ͏ʹͨ͠
    ʮʮελϒ͕ฦ͢஋ʯͷศརʙʯͷςϯϓϨʔτΛோΊͯΈΔ

    View full-size slide

  61. ࣗಈੜ੒͕೉͍͠΋ͷʹ͍ͭͯ͸ɺσϑΥϧτҾ਺ͷ஋Λʮ௚ॻ͖ʯͯ͠ग़ྗ͢Δ
    ʮʮελϒ͕ฦ͢஋ʯͷศརʙʯͷςϯϓϨʔτΛோΊͯΈΔ

    View full-size slide

  62. Πέςͳ͍ʁͰ΋ࣗಈੜ੒͸ʮࣗ෼ͨͪͰίϯτϩʔϧͰ͖Δʯ෦෼͕ൺֱతଟ͍ͷͰ
    దٓճආࡦ͕ݟ͚ͭ΍͍͢ϝϦοτͰ΋͋Δͱೝ͍ࣝͯ͠Δ
    ʮʮελϒ͕ฦ͢஋ʯͷศརʙʯͷςϯϓϨʔτΛோΊͯΈΔ

    View full-size slide

  63. ͦΕҎ֎͸ผͷ&OUJUZͷ͸ͣͳͷͰɺͦΕΒʹ͍ͭͯ͸σϑΥϧτҾ਺ͷ஋ͱͯͦ͠ͷ&OUJUZͷϏϧμʔϝιουΛग़ྗ͢Δ
    ʮʮελϒ͕ฦ͢஋ʯͷศརʙʯͷςϯϓϨʔτΛோΊͯΈΔ

    View full-size slide

  64. 4PVSDFSZ4UFODJMิ଍
    • ઌ΄Ͳ͸SourceryͷCLIΛར༻ͯࣗ͠ಈੜ੒Λߦͳ͕ͬͨɺ࣮ࡍʹӡ༻͢Δࡍ͸

    ʮ”Run Script”ʹίϚϯυΛهड़ͯ͠Ϗϧυຖʹ࣮ߦʯͱͳΔ͸ͣ
    • “sources” / “templates” / “output” ͳͲͷҾ਺͸”.sourcery.yml”ʹ·ͱΊΔ͜ͱ͕Ͱ͖Δ
    • ΈͯͶͰ͸ग़ྗઌ͕ෳ਺ʢΞϓϦ/ςετʣඞཁͷͨΊ”.sourcery.yml”͸࢖͑ͳ͍
    • ࢀߟ -> https://github.com/krzysztofzablocki/Sourcery/issues/727

    View full-size slide

  65. Sourcery / Stencil Λ׆༻͢Δ͏͑ͰͷTIPS

    View full-size slide

  66. υΩϡϝϯτͱᛀΊͬ͜͢Δඞཁ͕͋Δ

    View full-size slide

  67. υΩϡϝϯτͱᛀΊͬ͜͢Δඞཁ͕͋Δ
    ྫ͑͹͜ͷzTUSVDUz͔ΒɺଞʹͲΜͳ஋Λࢀর͢Δ͜ͱ͕Ͱ͖Δͷʁ

    View full-size slide

  68. υΩϡϝϯτͱᛀΊͬ͜͢Δඞཁ͕͋Δ

    View full-size slide

  69. υΩϡϝϯτͱᛀΊͬ͜͢Δඞཁ͕͋Δ
    lLJOEzϓϩύςΟ͔͠ͳ͍ʁ

    View full-size slide

  70. υΩϡϝϯτͱᛀΊͬ͜͢Δඞཁ͕͋Δ
    l5ZQFzͱ͍͏ΫϥεΛܧঝ͍ͯ͠Δ

    View full-size slide

  71. υΩϡϝϯτͱᛀΊͬ͜͢Δඞཁ͕͋Δ
    lOBNFzlBMM7BSJBCMFTzlBMM.FUIPETzͳͲͷʮྑ͘࢖͍ͦ͏ͳʯϓϩύςΟ͕͋Δ

    View full-size slide

  72. υΩϡϝϯτͱᛀΊͬ͜͢Δඞཁ͕͋Δ
    1. ࣗಈੜ੒͍ͨ͠΋ͷΛΠϝʔδ͢ΔʢPlanʣ
    2. υΩϡϝϯτΈͭͭɺͱΓ͋͑ͣࣗಈੜ੒ͯ͠ΈΔʢDoʣ
    3. ࣗಈੜ੒͞Εͨ΋ͷΛ֬ೝ͢ΔʢCheckʣ
    4. Πϝʔδ͍ͯͨ͠΋ͷ͕ਖ਼͘͠ੜ੒͞Ε͍ͯͳ͔ͬͨͷͰɺ࠶౓υΩϡϝϯτݟ௚͢ʢActionʣ
    • PDCAαΠΫϧΛճ͍ͯ͘͠ײ͡ʹͳΔ͸ͣ

    View full-size slide

  73. υΩϡϝϯτͱᛀΊͬ͜͢Δඞཁ͕͋Δ
    • Sourcery -> https://cdn.rawgit.com/krzysztofzablocki/Sourcery/master/docs/index.html
    • Stencil -> https://stencil.fuller.li/en/latest/

    View full-size slide

  74. 4UFODJM4XJGU,JUΛ஌͓ͬͯ͘
    • https://github.com/SwiftGen/StencilSwiftKit
    • Stencilͷ֦ுػೳΈ͍ͨͳ΋ͷ
    • Stenicilͷඪ४ػೳ͚ͩͰ͸࣮ݱͰ͖ͳ͍΋ͷΛ࣮ݱͰ͖Δ
    • Stenicilͷඪ४ػೳ͚ͩͰ͸࣮ݱ͢Δͷ͕େมͳ΋ͷΛ؆୯ʹ࣮ݱͰ͖Δ
    • SourceryͷREADMEʹ͸Ұ੾هड़͕ͳ͍͕ɺSourcery͔Βར༻Ͱ͖Δ
    • ͪ͜Β΋υΩϡϝϯτΈͯɺར༻Ͱ͖ΔػೳΛ೺Ѳ͓ͯ͘͠ͱྑ͍

    View full-size slide

  75. • ಛʹ”macro”͸ศར
    • ଞʹ΋ศརͳ΋ͷ͕ͨ͘͞Μ͋Δ
    • “Map”ͱ͍͏tag΍ɺ”hasPrefix”ͱ͍͏filter͸ΈͯͶͰ͸ར༻͍ͯ͠Δ
    4UFODJM4XJGU,JUΛ஌͓ͬͯ͘

    View full-size slide

  76. NBDSPͷྫ
    4UFODJM4XJGU,JUΛ஌͓ͬͯ͘

    View full-size slide

  77. Ұ෦ͷςϯϓϨʔτΛNBDSPͱͯ͠ఆٛͰ͖Δ
    4UFODJM4XJGU,JUΛ஌͓ͬͯ͘

    View full-size slide

  78. NBDSPΛผͷ৔ॴ͔Βݺͼग़͢͜ͱ͕Ͱ͖Δɻ
    ςϯϓϨʔτΤϯδϯͷՄಡੑΛ͋͛ͨΓɺಉ͡Α͏ͳςϯϓϨʔτΛॻ͘͜ͱΛආ͚Δ͜ͱ͕Ͱ͖Δ
    4UFODJM4XJGU,JUΛ஌͓ͬͯ͘

    View full-size slide

  79. 4PVSDFSZͷʮαϯϓϧूʯΛࢀߟʹ͢Δ
    IUUQTHJUIVCDPNLS[ZT[UPG[BCMPDLJ4PVSDFSZUSFFNBTUFS5FNQMBUFT5FNQMBUFT

    View full-size slide

  80. ࣗಈੜ੒ΛͲ͜·Ͱ࢓্͛Δ΂͖͔
    • ࣗಈੜ੒Λߦ͏্Ͱɺ࣮ݱ͢Δͷ͕Ͳ͏ͯ͠΋೉͍͠ίʔφʔέʔε͕Ͱ͖ͯͨͱ͖
    • ͋·ΓʮؤுΓ͗͢ͳ͍ʯ͜ͱ
    • ʮϝϯςͰ͖ͳ͍ʯςϯϓϨʔτϑΝΠϧ͸࡞Γͨ͘ͳ͍
    • νʔϜͰӡ༻Ͱ͖Δ͜ͱ͕ॏཁ
    • ճආࡦ͸͋Δ
    • ςϯϓϨʔτଆͰճආ͢Δ -> ྫ) ʮελϒ͕ฦ͢஋ʯͷศརϏϧμʔϝιου
    • ࣗಈੜ੒ͷର৅͔Β֎͢ʢͦΕΒ͸खͰॻ͘ʣ

    View full-size slide

  81. • ࣗಈੜ੒ͷର৅͔Β֎͢ = ର৅ϑΝΠϧΛʮࡉ͔͘ʯద༻͢Δ͜ͱ΋Ͱ͖Δ
    • બ୒ύλʔϯ
    • ઐ༻ͷprotocolΛ࡞੒͠ద༻͢ΔʢͦͷprotocolΛࣗಈੜ੒ର৅ͷ໨ҹͱ͢Δʣ
    • আ֎ύλʔϯ
    • ʢҰൠతͰ͸ͳ͍͕ɺΈͯͶͰ͸ͪ͜ΒͰӡ༻͍ͯ͠Δʣ
    • আ֎͢Δ class/struct/protocolʢͳͲʣ ໊ΛςϯϓϨʔτϑΝΠϧʹʮϕλॻ͖ʯͯ͠ɺif
    จͳͲͰআ֎͢Δ
    ࣗಈੜ੒ΛͲ͜·Ͱ࢓্͛Δ΂͖͔

    View full-size slide

  82. ࡶʹ࣮૷ɺͦͷ͋ͱϦϑΝΫλϦϯά
    1. ͪΐͬͱԚ͍͕ɺ໨త௨Γͷ΋ͷ͕ࣗಈੜ੒͞ΕΔςϯϓϨʔτΛॻ͘
    2. Ұ୴ίϛοτ
    3. ϦϑΝΫλ͠ͳ͕Β౎౓ࣗಈੜ੒ -> ࣗಈੜ੒͞ΕΔ΋ͷʹࠩ෼͕ͳ͚Ε͹OK
    • ʢςετ͕͋Δ͔Β҆৺ͯ͠ϦϑΝΫλͰ͖ΔͷͱࣅͯΔʣ

    View full-size slide

  83. 1೥ؒӡ༻ͯ͠ΈͯͷॴײͳͲ

    View full-size slide

  84. ಛʹେ͖ͳ໰୊͸ى͖ͨ͜ͱ͕ͳ͍
    • ઌड़ͨ͠ͱ͓ΓɺҎԼͷΑ͏ͳ͜ͱ͕Ͱ͖ΔͨΊ
    • ςϯϓϨʔτʹԿ͔͠ΒखΛೖΕͯճආ
    • ࣗಈੜ੒ͷର৅͔Β֎͢

    View full-size slide

  85. ࣗಈੜ੒WTϥΠϒϥϦʁ
    • DIͱ͔ϞοΫ͸ʮαʔυύʔςΟͷϥΠϒϥϦΛ࢖͑͹ྑ͍ͷͰ͸ʁʯͱࢥͬͨํ΋ଟ͍͸ͣ

    View full-size slide

  86. • ϥΠϒϥϦͷ؅ཧίετ͸ҙ֎ʹߴ͍
    • ࠷৽ͷόʔδϣϯʹ௥ै͢Δίετ
    • ສ͕Ұಈ͔ͳ͘ͳͬͨͱ͖/ෆ۩߹͕ग़ͨͱ͖ͷରԠίετ
    • ՝୊ղܾ͢Δ͏͑ͰɺαʔυύʔςΟͷϥΠϒϥϦΛར༻͢Δͱ͍͏બ୒ࢶͱಉ౳ʹʮࣗಈੜ
    ੒ʯΛར༻͢Δͱ͍͏બ୒ࢶ΋ฒ΂ͯྑ͍ͷͰ͸
    ࣗಈੜ੒WTϥΠϒϥϦʁ

    View full-size slide

  87. ·ͱΊ
    • ՝୊ղܾͷ1ͭͱͯ͠ʮࣗಈੜ੒ʯΛݕ౼ʹೖΕͯΈͯ͸Ͳ͏͔
    • ࣗಈੜ੒ΛͲ͜·Ͱ΍Γ੾Δ͔͸ҙࣝ͢Δͱྑͦ͞͏

    View full-size slide

  88. ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠!!!

    View full-size slide