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

会話しながらコード書くと幸せになれると思う(改訂版)

 会話しながらコード書くと幸せになれると思う(改訂版)

初心者向けのオブジェクト指向の説明を書いたのですが、いきなり継承、多様性、隠蔽化を話すより、当スライドのような考え方から始めたほうがオブジェクト指向を理解出来るのでは、と思い前回の仕様を改訂しました。

TsukasaSekiguchi

December 25, 2017
Tweet

More Decks by TsukasaSekiguchi

Other Decks in Technology

Transcript

  1. ձ࿩͠ͳ͕Βίʔυॻ͘
    ͱ޾ͤʹͳΕΔͱࢥ͏

    View full-size slide

  2. ίʔυॻ͘ͱ͖ձ࿩͠
    ͯ·͔͢ʁ

    View full-size slide

  3. ԿΛ࿩͢ͷʁ

    View full-size slide

  4. ͓લԿ͍ͨ͠Μ͚ͩͬʁ

    View full-size slide

  5. ͱ͋Δ&$αΠτͰɺಛఆͷ
    Ϣʔβʔ͕ϩάΠϯ͍ͯ͠Δ࣌
    ͚ͩཪϝχϡʔΛද͍ࣔͤͨ͞

    View full-size slide

  6. ձ࿩ͯ͠ΈΔ

    View full-size slide

  7. ͓લ͕΍Γ͍ͨͷͬͯ
    ཪϝχϡʔΛදࣔͤ͞Δ͔Ͳ͏͔ͩΑͶʁ

    View full-size slide

  8. ͓લ͕΍Γ͍ͨͷͬͯ
    ϩάΠϯ൑ఆ͡Όͳ͍ΑͶʁ

    View full-size slide

  9. ͓લ͕΍Γ͍ͨͷͬͯ
    ձһछผͷऔಘ͡Όͳ͍ΑͶʁ

    View full-size slide

  10. ͓લ͕΍Γ͍ͨͷͬͯ
    Ωϟϯϖʔϯ঎඼Λങͬͨ͜ͱ͋Δ͔
    Ͳ͏͔ͷ൑ఆ͡Όͳ͍ΑͶʁ

    View full-size slide

  11. ͓લ͕΍Γ͍ͨͷͬͯ
    ͜ΕͩΑͶʂ

    View full-size slide

  12. ձ࿩ͷ݁ՌΛ
    ͦͷ··൓өͤͯ͞ΈΔ

    View full-size slide

  13. ˞ϖʔδʹऩΊΔͨΊ143 ίʔυن໿
    ͔Β֎Εͨॻ͖ํͯ͠·͢

    View full-size slide

  14. ˞ϖʔδʹऩΊΔͨΊ143 ίʔυن໿
    ͔Β֎Εͨॻ͖ํͯ͠·͢
    ϝιου໊ͱ࣮ࡍʹ΍ͬͯΔ͜ͱ͕
    Ұகͯ͠ΔͶʂ

    View full-size slide

  15. ͪΐͬͱ଴ͯΑ

    View full-size slide

  16. ˞ϖʔδʹऩΊΔͨΊ143 ίʔυن໿
    ͔Β֎Εͨॻ͖ํͯ͠·͢

    View full-size slide

  17. ˞ϖʔδʹऩΊΔͨΊ143 ίʔυن໿
    ͔Β֎Εͨॻ͖ํͯ͠·͢
    ࣅͨΑ͏ͳҾ਺Կճ΋౉͢ͷͩΔ͘ͳ͍͔ʁ

    View full-size slide

  18. Ϋϥε࡞Ζ͏ͥ

    View full-size slide

  19. Ͳ͏΍ͬͯ࡞Δʁ

    View full-size slide

  20. ొ৔ਓ෺୭͚ͩͬʁ

    View full-size slide

  21. ಉ͡ྫͰ΍ͬͯΈΔ

    View full-size slide

  22. ˞ϖʔδʹऩΊΔͨΊ143 ίʔυن໿
    ͔Β֎Εͨॻ͖ํͯ͠·͢

    View full-size slide

  23. ˞ϖʔδʹऩΊΔͨΊ143 ίʔυن໿
    ͔Β֎Εͨॻ͖ํͯ͠·͢

    View full-size slide

  24. ˞ϖʔδʹऩΊΔͨΊ143 ίʔυن໿
    ͔Β֎Εͨॻ͖ํͯ͠·͢
    ձһ͍Δͳ

    View full-size slide

  25. ˞ϖʔδʹऩΊΔͨΊ143 ίʔυن໿
    ͔Β֎Εͨॻ͖ํͯ͠·͢
    ձһ

    View full-size slide

  26. ˞ϖʔδʹऩΊΔͨΊ143 ίʔυن໿
    ͔Β֎Εͨॻ͖ํͯ͠·͢
    ձһ

    View full-size slide

  27. ˞ϖʔδʹऩΊΔͨΊ143 ίʔυن໿
    ͔Β֎Εͨॻ͖ํͯ͠·͢
    ձһ
    ঎඼ͱ঎඼Ұཡ͍Δͳ

    View full-size slide

  28. ˞ϖʔδʹऩΊΔͨΊ143 ίʔυن໿
    ͔Β֎Εͨॻ͖ํͯ͠·͢
    ձһ
    ঎඼Ұཡ
    ঎඼

    View full-size slide

  29. ˞ϖʔδʹऩΊΔͨΊ143 ίʔυن໿
    ͔Β֎Εͨॻ͖ํͯ͠·͢
    ձһ
    ঎඼Ұཡ
    ঎඼

    View full-size slide

  30. ˞ϖʔδʹऩΊΔͨΊ143 ίʔυن໿
    ͔Β֎Εͨॻ͖ํͯ͠·͢
    ձһ
    ঎඼Ұཡ
    ঎඼
    ཪϝχϡʔ͍Δͳ

    View full-size slide

  31. ˞ϖʔδʹऩΊΔͨΊ143 ίʔυن໿
    ͔Β֎Εͨॻ͖ํͯ͠·͢
    ձһ
    ঎඼Ұཡ
    ঎඼
    ཪϝχϡʔ

    View full-size slide

  32. ˞ϖʔδʹऩΊΔͨΊ143 ίʔυن໿
    ͔Β֎Εͨॻ͖ํͯ͠·͢
    ձһ
    ঎඼Ұཡ
    ঎඼
    ཪϝχϡʔ
    ొ৔ਓ෺ग़͖ͯͨͶʂ

    View full-size slide

  33. ձ࿩ͷ݁ՌΛ
    ͦͷ··൓өͤͯ͞ΈΔ

    View full-size slide

  34. ˞ϖʔδʹऩΊΔͨΊ143 ίʔυن໿
    ͔Β֎Εͨॻ͖ํͯ͠·͢
    ϝΠϯϓϩάϥϜ Ϋϥε܈

    View full-size slide

  35. ˞ϖʔδʹऩΊΔͨΊ143 ίʔυن໿
    ͔Β֎Εͨॻ͖ํͯ͠·͢
    ϝΠϯϓϩάϥϜ Ϋϥε܈
    εοΩϦͨ͠Ͷʂ

    View full-size slide

  36. ͪΐͬͱ଴ͯΑ

    View full-size slide

  37. ˞ϖʔδʹऩΊΔͨΊ143 ίʔυن໿
    ͔Β֎Εͨॻ͖ํͯ͠·͢
    ಛผձһɺ௨ৗձһɺΧςΰϦʔͱ͔΋
    ొ৔ਓ෺͡Όͳ͍ͷʁ

    View full-size slide

  38. ˞ϖʔδʹऩΊΔͨΊ143 ίʔυن໿
    ͔Β֎Εͨॻ͖ํͯ͠·͢
    ಛผձһɺ௨ৗձһɺΧςΰϦʔͱ͔΋
    ొ৔ਓ෺͡Όͳ͍ͷʁ

    ొ৔ਓ෺ͷఆٛͬͯԿʁ

    View full-size slide

  39. ͳΜ͔࣋ͬͯͨΒ
    ਓʹ͠Α͏

    View full-size slide

  40. ʮ࣋ͭʯͬͯͳΜͩʁ

    View full-size slide

  41. ˞ϖʔδʹऩΊΔͨΊ143 ίʔυن໿
    ͔Β֎Εͨॻ͖ํͯ͠·͢
    ϝΠϯϓϩάϥϜ Ϋϥε܈

    View full-size slide

  42. ˞ϖʔδʹऩΊΔͨΊ143 ίʔυن໿
    ͔Β֎Εͨॻ͖ํͯ͠·͢
    ϝΠϯϓϩάϥϜ Ϋϥε܈
    ձһ͸JE ձһछผɺങͬͨ঎඼Λ
    ࣋ͬͯΔͶʂ

    View full-size slide

  43. ˞ϖʔδʹऩΊΔͨΊ143 ίʔυن໿
    ͔Β֎Εͨॻ͖ํͯ͠·͢
    ϝΠϯϓϩάϥϜ Ϋϥε܈
    ঎඼͸ΧςΰϦʔΛ
    ࣋ͬͯΔͶʂ

    View full-size slide

  44. ˞ϖʔδʹऩΊΔͨΊ143 ίʔυن໿
    ͔Β֎Εͨॻ͖ํͯ͠·͢
    ϝΠϯϓϩάϥϜ Ϋϥε܈
    ঎඼Ұཡ͸঎඼Λ
    ࣋ͬͯΔͶʂ

    View full-size slide

  45. ˞ϖʔδʹऩΊΔͨΊ143 ίʔυن໿
    ͔Β֎Εͨॻ͖ํͯ͠·͢
    ϝΠϯϓϩάϥϜ Ϋϥε܈
    ཪϝχϡʔ͸දࣔ͢Δ͔Λ
    ࣋ͬͯΔͶʂ

    View full-size slide

  46. ˞ϖʔδʹऩΊΔͨΊ143 ίʔυن໿
    ͔Β֎Εͨॻ͖ํͯ͠·͢
    ϝΠϯϓϩάϥϜ Ϋϥε܈
    ಛผձһɺ௨ৗձһ͸
    Կ΋࣋ͬͯͳ͍Ͷʂ

    ˞ࠓճͷྫͰ͸࣋ͬͯͳ͔͚ͬͨͲɺ
    ʮಛผձһʹ͸ϥϯΫ͕͋Δʯ
    ʮ௨ৗձһʹ͸༗ޮظݶ͕͋Δʯ
    ͱ͔ঢ়گʹΑͬͯ͸࣋ͪ෺ग़ͯ͘Δ͔ΒͶʂ

    View full-size slide

  47. ˞ϖʔδʹऩΊΔͨΊ143 ίʔυن໿
    ͔Β֎Εͨॻ͖ํͯ͠·͢
    ϝΠϯϓϩάϥϜ Ϋϥε܈
    ΧςΰϦʔ͸
    Կ΋࣋ͬͯͳ͍Ͷʂ

    ˞ࠓճͷྫͰ͸࣋ͬͯͳ͔͚ͬͨͲɺ
    ʮΧςΰϦʔͷதʹαϒΧςΰϦʔ͕͋Δʯ
    ʮΧςΰϦʔ͝ͱʹ৭͕ܾ·ͬͯΔʯ
    ͱ͔ঢ়گʹΑͬͯ͸࣋ͪ෺ग़ͯ͘Δ͔ΒͶʂ

    View full-size slide

  48. ϝιου࡞Δ࣌͸
    ʮ͓લԿ͍ͨ͠Μ͚ͩͬʁʯ
    ͱ࿩͔͚ͯ͠ɺϝιου͕ຊ౰ʹ΍Γ͍ͨ͜ͱͱ΍ͬͯΔ
    ͜ͱ͕Ұகͯ͠Δͷ͔֬ೝ͠·͠ΐ͏
    Ϋϥε࡞Δ࣌͸
    ʮొ৔ਓ෺୭͚ͩͬʁʯ
    ʮ͓લͳΜ͔࣋ͬͯΔ͚ͬʁʯ
    ͱ࿩͔͚ͯ͠ɺΫϥεʹ͢΂͖͔֬ೝ͠·͠ΐ͏

    View full-size slide

  49. ͜Ε͸޾ͤͷ
    ͖͔͚ͬͮ͘ΓͰ͢

    View full-size slide

  50. ؒҧ͍ͬͯΔͱ͜Ζ΋
    ͨ͘͞Μ͋Γ·͢

    View full-size slide

  51. Ͱ΋ϓϩάϥϜͱ
    ஥ྑ͘ͳΔ͖͔͚ͬ͸
    ͜ΕͰେৎ෉ͩͱࢥ͍·͢

    View full-size slide

  52. ϓϩάϥϜʹ͸ʮ͜Ε͕ਖ਼ղʯ
    ͱ͍͏ͷ͸͋Γ·ͤΜ
    օ͞Μࣗ෼ͳΓͷਖ਼ղΛ
    ݟ͚͍͖ͭͯ·͠ΐ͏

    View full-size slide

  53. /P$POWFSTBUJPO
    /P$PEJOH

    View full-size slide