Annotation Processingを 駆使したコード生成で ボイラープレートコードを駆逐しよう!

16d3962b8f11b7e801dacb129d20d8dd?s=47 KazaKago
February 07, 2018

Annotation Processingを 駆使したコード生成で ボイラープレートコードを駆逐しよう!

DroidKaigi 2018発表資料
2018/02/08 16:50~17:20 Room5

スライド内のリンク・補足はこちらから
http://kazakago.hatenablog.jp/entry/2018/02/07/152011

16d3962b8f11b7e801dacb129d20d8dd?s=128

KazaKago

February 07, 2018
Tweet

Transcript

  1. Annotation ProcessingΛ ۦ࢖ͨ͠ίʔυੜ੒Ͱ ϘΠϥʔϓϨʔτίʔυΛۦஞ͠Α͏ʂ @KazaKago DroidKaigi 2018 2018/02/08 Thu. (Day

    1) 16:50-17:20 Room5
  2. Self-Introduction • ాଜ ݠհʢ@KazaKagoʣ • גࣜձࣾΠάχεॴଐ • ࿀Ѫ࿀׆ΞϓϦʮwithʯ։ൃϝϯόʔ • AndroidΞϓϦ։ൃྺ͸6~7೥͘Β͍

  3. Self-Introduction • ాଜ ݠհʢ@KazaKagoʣ • גࣜձࣾΠάχεॴଐ • ࿀Ѫ࿀׆ΞϓϦʮwithʯ։ൃϝϯόʔ • AndroidΞϓϦ։ൃྺ͸6~7೥͘Β͍

  4. Self-Introduction ϝϯλϦετDaiGo؂म
 ࿀Ѫɾ࿀׆ϚονϯάαʔϏεʮwithʯ

  5. 0. લஔ͖ طଘίʔυΛோΊΔɺ͘͝ҰൠతͳΤϯδχΞͷྫ

  6. 0. લஔ͖ ಉ͡ίʔυ͕2ճॻ͔Ε͍ͯͨ࣌

  7. 0. લஔ͖ ಉ͡ίʔυ͕2ճॻ͔Ε͍ͯͨ࣌

  8. 0. લஔ͖ ಉ͡ίʔυ͕3ճॻ͔Ε͍ͯͨ࣌

  9. 0. લஔ͖ ಉ͡ίʔυ͕3ճॻ͔Ε͍ͯͨ࣌

  10. 0. લஔ͖ ಉ͡ίʔυ͕4ճҎ্ॻ͔Ε͍ͯͨ࣌

  11. 0. લஔ͖ ಉ͡ίʔυ͕4ճҎ্ॻ͔Ε͍ͯͨ࣌

  12. ಉ͡ίʔυΛԿ౓΋ ॻ͘ͷ͸ͭΒ͍ 0. લஔ͖

  13. ॲཧΛ·ͱΊͯ
 ڞ௨Խ͠Α͏ʂ 0. લஔ͖

  14. 0. લஔ͖ ॲཧ͸ಉ͚ͩ͡Ͳ
 ౉͢ύϥϝʔλ͕ҟͳͬͯͯ
 ͏·͘ڞ௨ԽͰ͖ͳ͍ɾɾɾ ͳΜͯ͜ͱ΋

  15. Annotation Processing ʹΑΔίʔυੜ੒Ͱ
 ͰղܾͰ͖Δ͔΋ʁ 0. લஔ͖

  16. ໨࣍ 1. Annotation Processingͬͯʁ 2. Annotationͱίʔυੜ੒ 3. JavaPoetͱKotlinPoet 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔

    5. Kotlin͔Β࢖͏৔߹ͷ஫ҙ఺
  17. ໨࣍ 1. Annotation Processingͬͯʁ 2. Annotationͱίʔυੜ੒ 3. JavaPoetͱKotlinPoet 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔

    5. Kotlin͔Β࢖͏৔߹ͷ஫ҙ఺
  18. 1. Annotation Processingͬͯʁ Processing Annotation

  19. 1. Annotation Processingͬͯʁ Processing Annotation

  20. 1. Annotation Processingͬͯʁ • Java5 SE͔Βొ৔ • @͔Β࢝·Δɺίʔ υʹରͯ͠஫ऍΛೖ ΕΔػೳ

    • @Override΍ @Deprecated͸Ұ౓ ͸ݟͨ͜ͱ͋Δ͸ͣ ←ίϨʂ ࣗ࡞Annotationͷྫ Α͘ݟΔAnnotationͷྫ
  21. 1. Annotation Processingͬͯʁ Processing Annotation

  22. 1. Annotation Processingͬͯʁ Processing Annotation

  23. 1. Annotation Processingͬͯʁ • ਖ਼֬ʹ͸Pluggable Annotation Processing API • Java6

    SE͔Βొ৔ • Ϗϧυ࣌ʹ Annotationʹରͯ͠ ಛఆͷॲཧΛߦ͏࢓ ૊Έ Ϗϧυ։࢝ ίϯύΠϧ࣮ߦ Annotation Processing࣮ߦ ͳΜ΍͔Μ΍ͷޙϏϧυऴྃ ※͍Ζ͍Ζ୺ંͬͯ·͢
  24. 1. Annotation Processingͬͯʁ ༗໊Ͳ͜ΖͷϥΠϒϥϦʹ΋Α͘׆༻͞Ε͍ͯ·͢ɻ

  25. 1. Annotation Processingͬͯʁ ༗໊Ͳ͜ΖͷϥΠϒϥϦʹ΋Α͘׆༻͞Ε͍ͯ·͢ɻ

  26. ࣮ࡍԿ΍ͬͯΔͷ͔
 ݟͨ͜ͱ͋Δʁ 1. Annotation Processingͬͯʁ

  27. 1. Annotation Processingͬͯʁ • JakeWharton / Butterknife http://jakewharton.github.io/butterknife/

  28. 1. Annotation Processingͬͯʁ • Butterknifeͷ৔߹

  29. 1. Annotation Processingͬͯʁ 3ͭͷ
 Annotationɹ →

  30. 1. Annotation Processingͬͯʁ 3ͭͷ
 Annotationɹ 42ߦͷΫϥε͕
 ੜ੒͞ΕͯΔʂ →

  31. 1. Annotation Processingͬͯʁ • maskarade / Android-Orma https://github.com/maskarade/Android-Orma

  32. 1. Annotation Processingͬͯʁ • Android-Ormaͷ৔߹

  33. 1. Annotation Processingͬͯʁ 4ΧϥϜͷ
 1ςʔϒϧʢΫϥεʣ →

  34. 1. Annotation Processingͬͯʁ 4ΧϥϜͷ
 1ςʔϒϧʢΫϥεʣ → ܭ1175ߦʢʂʁʣ
 ͷίʔυੜ੒

  35. 1. Annotation Processingͬͯʁ ͜Ε͚ͩͷίʔυΛ ॻ͘ख͕ؒল͚Δʂ

  36. ͭ·Γ… 1. Annotation Processingͬͯʁ

  37. ͦͷ෼ͷ࣌ؒΛ
 ༗ҙٛʹ࢖͑Δʂ 1. Annotation Processingͬͯʁ

  38. 1. Annotation Processingͬͯʁ ੜ੒͞Εͨιʔείʔυ͸ҎԼ΁഑ஔ͞Εͯ·͢
 {MODULE}/build/generated/source/apt/

  39. ໨࣍ 1. Annotation Processingͬͯʁ 2. Annotationͱίʔυੜ੒ 3. JavaPoetͱKotlinPoet 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔

    5. Kotlin͔Β࢖͏৔߹ͷ஫ҙ఺
  40. ໨࣍ 1. Annotation Processingͬͯʁ 2. Annotationͱίʔυੜ੒ 3. JavaPoetͱKotlinPoet 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔

    5. Kotlin͔Β࢖͏৔߹ͷ஫ҙ఺
  41. Annotation Processing Λ࢖ͬͯίʔυੜ੒
 ͢Δʹ͸ʁ 2. Annotationͱίʔυੜ੒

  42. 2. Annotationͱίʔυੜ੒ ProcessingΛߦ͏ʹ͸ɺAbstractProcessorΛܧঝͨ͠ ProcessorΫϥεΛ࡞Γ·͢ processϝιου΁AnnotationΛ͚ͭͨର৅͕Πϕϯτͱ ͯ͠ίϯύΠϧલʹྲྀΕ͖ͯ·͢

  43. 2. Annotationͱίʔυੜ੒ ͜ͷAbstractProcessorΫϥεɺAndroid Application΍ Android LibraryͩͱΫϥεࣗମ͕ଘࡏ͠ͳ͍ͷͰ
 Java LibraryͰಋೖͯ͠Լ͍͞

  44. 2. Annotationͱίʔυੜ੒ ͜ͷAbstractProcessorΫϥεɺAndroid Application΍ Android LibraryͩͱΫϥεࣗମ͕ଘࡏ͠ͳ͍ͷͰ
 Java LibraryͰಋೖͯ͠Լ͍͞

  45. Google / AutoService 2. Annotationͱίʔυੜ੒ https://github.com/google/auto/tree/master/service

  46. ProcessorΫϥεʹରͯ͠@AutoServiceΞϊςʔγϣϯ Λ෇༩͢Δ͜ͱͰϏϧυ࣌ʹࣗಈతʹProcessingͤ͞ Δ͜ͱ͕ՄೳͰ͢ 2. Annotationͱίʔυੜ੒

  47. ίʔυੜ੒Λߦ͏ʹ͸ɺProcessorΫϥεͰऔಘͰ͖Δ processingEnvม਺͔ΒwriterΫϥεΛऔಘͯ͠ιʔε ίʔυͷ಺༰Λྲྀ͠ࠐΈ·͢ 2. Annotationͱίʔυੜ੒

  48. 2. Annotationͱίʔυੜ੒ process()ϝιουͰ౉͞ΕΔRoundEnvironmentҾ਺Λ ࢖͏ͱɺAnnotationΛ෇༩͞Εͨର৅ΛElementͱ͍͏ ୯ҐͰऔಘ͢Δ͜ͱ͕ग़དྷ·͢ɻ
 ElementΫϥε͔Β͸ܕ΍ύοέʔδ໊ɺΫϥε໊ͳͲ ιʔείʔυʹؔΘΔ΋ͷ͸͍͍ͩͨऔಘͰ͖·͢ MyAnnotation͕෇༩͞ΕͨҰཡͷऔಘྫ

  49. 2. Annotationͱίʔυੜ੒ Q. Ͳ͏΍ͬͯίʔυॻ͘ͷʁ

  50. 2. Annotationͱίʔυੜ੒ A. JavaPoetΛ࢖͏ͷ͕ ͓͢͢Ίʂ

  51. ໨࣍ 1. Annotation Processingͬͯʁ 2. Annotationͱίʔυੜ੒ 3. JavaPoetͱKotlinPoet 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔

    5. Kotlin͔Β࢖͏৔߹ͷ஫ҙ఺
  52. ໨࣍ 1. Annotation Processingͬͯʁ 2. Annotationͱίʔυੜ੒ 3. JavaPoetͱKotlinPoet 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔

    5. Kotlin͔Β࢖͏৔߹ͷ஫ҙ఺
  53. Square / JavaPoet 3. JavaPoetͱKotlinPoet https://github.com/square/javapoet

  54. Square / KotlinPoet 3. JavaPoetͱKotlinPoet https://github.com/square/kotlinpoet

  55. 3. JavaPoetͱKotlinPoet ͲͪΒ΋Javaݴޠ࢓༷Ͱ͸αϙʔτ͞Ε͍ͯͳ͍ Java(Kotlin)ιʔείʔυΛಈతʹੜ੒͢ΔͨΊͷϥΠϒ ϥϦɻ • JavaPoet • Javaίʔυੜ੒ →

    Java&Kotlin݉༻ • KotlinPoet • Kotlinίʔυੜ੒ → Kotlinʢ͕ϏϧυͰ͖Δ؀ڥʣ ઐ༻
  56. 3. JavaPoetͱKotlinPoet ࡞੒͍ͨ͠Ϋϥε໊΍ύοέʔδΛTypeSpecΫϥε΁ ࢦఆ͢Δ͜ͱͰιʔείʔυΛੜ੒Ͱ͖·͢ ·ͨɺwriteToϝιου΁processingEnv.getFiler()ΛҾ ਺ͱͯ͠ࢦఆ͢Δ͜ͱͰίϯύΠϧର৅ͱؚͯ͠ΊΔ ͜ͱ͕ՄೳͰ͢

  57. 3. JavaPoetͱKotlinPoet TypeSpecʹ͸ιʔείʔυΛಈతʹ
 هड़͢ΔͨΊʹ༷ʑͳ৘ใΛࢦఆͰ͖·͢

  58. 3. JavaPoetͱKotlinPoet • جఈͱͳΔSuperΫϥεͷࢦఆ • ίϯετϥΫλͷఆٛ • private΍publicͳͲͷम০ࢠͷ෇༩ • ϝιουͷఆٛ

    • ϑΟʔϧυม਺ɺϩʔΧϧม਺ͷఆٛ • ͦͷଞ೚ҙͷίʔυͷૠೖ TypeSpecʹ͸ιʔείʔυΛಈతʹ
 هड़͢ΔͨΊʹ༷ʑͳ৘ใΛࢦఆͰ͖·͢
  59. ໨࣍ 1. Annotation Processingͬͯʁ 2. Annotationͱίʔυੜ੒ 3. JavaPoetͱKotlinPoet 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔

    5. Kotlin͔Β࢖͏৔߹ͷ஫ҙ఺
  60. ໨࣍ 1. Annotation Processingͬͯʁ 2. Annotationͱίʔυੜ੒ 3. JavaPoetͱKotlinPoet 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔

    5. Kotlin͔Β࢖͏৔߹ͷ஫ҙ఺
  61. 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔ • Android Frameworkͷݹ͍API͸ಛʹࣗಈԽͷ༨஍͕ ͋Δͱࢥ͍·͢ • ଞʹ΋ۀ຿্ɺಛ༗ͷ͓·͡ͳ͍తͳίʔυΛॻ͔ͳ ͚Ε͹ͳΒͳ͍৔߹ʹ΋ޮՌΛൃش͢ΔͱࢥΘΕ·͢

  62. 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔ • Android Frameworkͷݹ͍API͸ಛʹࣗಈԽͷ༨஍͕ ͋Δͱࢥ͍·͢ • ଞʹ΋ۀ຿্ɺಛ༗ͷ͓·͡ͳ͍తͳίʔυΛॻ͔ͳ ͚Ε͹ͳΒͳ͍৔߹ʹ΋ޮՌΛൃش͢ΔͱࢥΘΕ·͢ Orma

    Realm IcePick Permissions Dispatcher Android Annotations Dagger ButterKnife
  63. ၟӽͳ͕Β
 ࢲ͕ࣗ࡞ͨ͠ϥΠϒϥϦΛ
 ྫʹͯ͠Έ·͢ 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔

  64. ྫ1 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔

  65. 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔ SharedPreferences͸Key-ValueͰอଘ͢ΔͨΊɺΞϓϦ ͝ͱʹ࢖͍΍͘͢ϥοϓͨ͠ΫϥεΛॻ͘͜ͱ͕Α͋͘ Δͱࢥ͍·͢ɻ

  66. 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔

  67. อଘ͍ͨ͠ର৅͑͞
 Θ͔Ε͹ࣗಈతʹ૊Ίͦ͏ 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔

  68. 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔ KazaKago / Preferhythm https://github.com/KazaKago/Preferhythm

  69. 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔ ϥούʔΫϥεΛҎԼͷίʔυ͔Βੜ੒Ͱ͖ΔΑ͏ʹʂ

  70. 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔

  71. 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔ 7ߦˠ65ߦ Key໊΍
 ϝιου໊ͳͲ
 typo͠΍͍͢
 ෦෼Λࣗಈੜ੒

  72. 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔ ☺

  73. ྫ2 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔

  74. 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔ AndroidͰը໘ؒͰ஋Λ౉͢৔߹ɺKey-ValueͰ౉͢ͷͰ ؅ཧ͕൥ࡶ͔ͭtypoͷཁҼʹͳΓ΍͍͢෦෼Ͱ͢

  75. 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔

  76. 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔ ܕͱϑΟʔϧυ໊͑͞
 Θ͔Ε͹Bundleʹ٧ΊΔͷ͸
 ػցతʹ૊ΊΔΑͶ

  77. 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔ KazaKago / Factolize https://github.com/KazaKago/Factolize

  78. 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔ ౉͞ΕΔଆͷActivityͱม਺ʹAnnotationΛ͚͓ͭͯ͘ ͜ͱͰProcessor͕൑அͰ͖ΔΑ͏ʹ͠·͢

  79. 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔ AnnotationΛݩʹϑΝΫτϦʔϝιουΛࣗಈੜ੒ͯ͠ɺ
 ద੾ʹBundle΁٧ΊͯऔΓग़͢࢓૊ΈΛ࣮ݱ͍ͯ͠·͢ ࣗಈੜ੒Ϋϥε

  80. 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔ Activity΁෇༩ͨ͠
 2ՕॴͷAnnotation →

  81. 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔ Activity΁෇༩ͨ͠
 2ՕॴͷAnnotation → 38ߦͷΫϥε

  82. 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔ ☺

  83. 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔ AndroidϓϩδΣΫτ্Ͱ
 ࣮૷͢Δʹ͋ͨͬͯ

  84. 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔ AbstractProcessor͸Java Libraryʹ͔͠ଘࡏ͠ͳ͍ͷ ͰɺAndroidϓϩδΣΫτͰAnnotation ProcessingΛ࢖ ͏৔߹ɺϞδϡʔϧΛ͋Δఔ౓ࡉ͔͘෼͚ͨ΄͏͕औΓ ճ͠΍͍͢Ͱ͢

  85. 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔ Android LibraryϞδϡʔϧɺProcessor࣮૷Ϟδϡʔ ϧɺAnnotationఆٛϞδϡʔϧͷ3૚ߏ੒ΛΑ͘ݟ·͢

  86. 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔ Application Module Processor Module Library Module Annotation Module

    ΞϓϦ ϥΠϒϥϦ Java Library Android Library Java Library annotationProcessor (kapt) implementation implementation api Android Application
  87. ໨࣍ 1. Annotation Processingͬͯʁ 2. Annotationͱίʔυੜ੒ 3. JavaPoetͱKotlinPoet 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔

    5. Kotlin͔Β࢖͏৔߹ͷ஫ҙ఺
  88. ໨࣍ 1. Annotation Processingͬͯʁ 2. Annotationͱίʔυੜ੒ 3. JavaPoetͱKotlinPoet 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔

    5. Kotlin͔Β࢖͏৔߹ͷ஫ҙ఺
  89. 5. Kotlin͔Β࢖͏৔߹ͷ஫ҙ఺ Kotlin Java ϓϩύςΟ ϑΟʔϧυ GetterΛ࢖ͬͯऔಘ ϑΟʔϧυʹ௚઀ΞΫηε AnnotationΛ෇༩͢Δର৅͕Java͔Kotlin͔ʹΑͬͯɺ
 ΞΫηοαʔͷํ๏͕ҟͳΔ৔߹͕͋Δ͜ͱʹ஫ҙͰ͢

  90. 5. Kotlin͔Β࢖͏৔߹ͷ஫ҙ఺ Processor܅ Javaιʔείʔυ Kotlinιʔείʔυ ʁ JavaͱKotlinͷΞΫηοαʔͷҧ͍ʹΑͬͯɺϑΟʔϧ υͷ஋ΛऔಘͰ͖ͳ͍͜ͱ͕͋ΔͷͰProcessorΫϥε ͰKotlinΛߟྀ͢Δඞཁ͕͋Γ·͢

  91. 5. Kotlin͔Β࢖͏৔߹ͷ஫ҙ఺ • ରࡦ1. ϦϑϨΫγϣϯͰΞΫηε͢ΔίʔυΛੜ੒͢ Δ • ϝϦοτɿJava͔Kotlin͔Λ΄΅ҙࣝͤͣ࢖͏͜ͱ͕ Ͱ͖Δ •

    σϝϦοτɿ࣮ߦ଎౓͕஗͘ɺProguard౳Λ༻͍ͨ ೉ಡԽΛߦ͏ͱ৔߹ʹΑͬͯ͸আ֎ઃఆ͕ඞཁʹͳ Δ
  92. 5. Kotlin͔Β࢖͏৔߹ͷ஫ҙ఺ • ରࡦ2. ʢඞཁʹԠͯ͡ʣGetterΛܦ༝͢Δ • ϝϦοτɿϦϑϨΫγϣϯͷσϝϦοτ͕ൃੜ͠ͳ ͍ • σϝϦοτɿΞΫηε͢ΔϑΟʔϧυม਺΍ϝιο

    υΛprivateʹͰ͖ͳ͍ɻΧελϚΠζ͞Εͨ GetterɺSetter͕ࣗ࡞͞Ε͍ͯͨ৔߹ͦΕΛࢀর͠ ͯ͠·͏
  93. 5. Kotlin͔Β࢖͏৔߹ͷ஫ҙ఺ • ଞʹ΋Kotlinಛ༗ͷڍಈ͕Өڹ͢Δ͜ͱ΋͋ΔͨΊඞͣ JavaͱKotlinͰಈ࡞͢Δ͔֬ೝ͢Δ͜ͱΛ͓͢͢Ί͠· ͢ • Java΍KotlinͷݴޠόʔδϣϯʹΑͬͯ΋ɺαϙʔτ͠ ͍ͯͳ͍ίʔυΛੜ੒ͯ͠΋౰વಈ࡞ͤ͞Δ͜ͱ͕ग़ དྷͳ͍ͷͰ஫ҙͯ͠ωˑ

  94. ໨࣍ 1. Annotation Processingͬͯʁ 2. Annotationͱίʔυੜ੒ 3. JavaPoetͱKotlinPoet 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔

    5. Kotlin͔Β࢖͏৔߹ͷ஫ҙ఺
  95. ໨࣍ 1. Annotation Processingͬͯʁ 2. Annotationͱίʔυੜ੒ 3. JavaPoetͱKotlinPoet 4. Android։ൃʹ͓͍ͯͲͷΑ͏ʹ׆༻Ͱ͖Δͷ͔

    5. Kotlin͔Β࢖͏৔߹ͷ஫ҙ఺ ·ͱΊ
  96. ·ͱΊ Don't Repeat Yourself, Generate Your Code!

  97. αϯϓϧίʔυ https://github.com/KazaKago/AnnotationProcessingSample Annotation ProcessingΛ༻͍ͯ
 τʔετΛදࣔ͢ΔαϯϓϧͰ͢

  98. ࠷ޙʹ גࣜձࣾIGNISͰ͸ΤϯδχΞΛେืू͍ͯ͠·͢ʂ https://recruit.1923.co.jp/

  99. ࠷ޙʹ גࣜձࣾIGNISͰ͸ΤϯδχΞΛେืू͍ͯ͠·͢ʂ https://recruit.1923.co.jp/

  100. ࠷ޙʹ ͋Γ͕ͱ͏͍͟͝·ͨ͠ https://github.com/KazaKago/AnnotationProcessingSample αϯϓϧίʔυ https://github.com/KazaKago/Preferhythm Preferhythm Factolize https://github.com/KazaKago/Factolize