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

Dr. Springlove

Dr. Springlove

zhanpon

May 18, 2019
Tweet

More Decks by zhanpon

Other Decks in Technology

Transcript

  1. Dr. Springlove
    ·ͨ͸ࢲ͸೗Կʹͯ͠৺഑͢ΔͷΛࢭ
    ΊͯDIΛѪ͢ΔΑ͏ʹͳ͔ͬͨ

    View full-size slide

  2. ࣗݾ঺հ: @zhanpon
    » ࢓ࣄ1. Spring BootͰϨίϝϯσʔγϣϯγεςϜ։ൃ
    » ࢓ࣄ2. ࣾ಺ͷ਺ֶಉ޷ձͷΦʔΨφΠβʔ

    View full-size slide

  3. ͜ͷLTͰ఻͍͑ͨ͜ͱ

    View full-size slide

  4. "Dependency Injection: Principles,
    Practices, and Patterns"ͱ͍͏ຊ͕
    ૉ੖Β͍͠ͷͰ঺հ͍ͨ͠ʂ

    View full-size slide

  5. ڈ೥ͷ4݄ࠒ
    ͳΜ͔ม਺ʹ@Autowired͚ͬͯͭΔͱϑϨʔϜϫʔΫ͕ͦͷػೳΛఏڙ
    ͯ͘͠ΕΔΒ͍͠ɻSpring Bootͬͯศརͩͳʙ

    View full-size slide

  6. ڈ೥ͷ5݄ࠒʢͦͷ1ʣ
    ͋͋ɺ·ͨjava.lang.IllegalStateException: Failed to load
    ApplicationͩʂΞϊςʔγϣϯͩΒ͚ͰԿ΋Θ͔Βͳ͍ʔʔ

    View full-size slide

  7. ڈ೥ͷ5݄ࠒʢͦͷ2ʣ
    ;Ή;ΉɺDIͷઐ໳ॻ͕͋ΔΒ͍͠ɺಡΜͰΈΑ͏ɻ

    View full-size slide

  8. ͦͯ͠……։؟

    View full-size slide

  9. DIຊͷ͍͍ͱ͜Ζ
    1. ߟ࡯͕ଟ໘త
    2. ϑϨʔϜϫʔΫʹཔΒͳ͍

    View full-size slide

  10. ߟ࡯͕ଟ໘త

    View full-size slide

  11. ߟ࡯͕ଟ໘త
    ʮDI͚͖ͬͯͬΐ͘{஗ԆόΠϯσΟϯά,୯ମςετ}ͷͨΊʹ͋ΔΜͰ
    ͠ΐʯΈ͍ͨͳ୯७ͳ݁࿦ʹඈͼ͔ͭͳ͍

    View full-size slide

  12. ߟ࡯͕ଟ໘త
    ͜ͷຊͰ͸3ͭͷ࣠Ͱߟ࡯͞Ε͍ͯΔ
    1. Object Composition
    2. Object Lifetime
    3. Interception

    View full-size slide

  13. ϑϨʔϜϫʔΫʹཔΒͳ͍
    » Part 1: DIͷશମ૾
    » Part 2: Χλϩά
    » Part 3: ७ਮͳDI
    » Part 4: DIίϯςφ

    View full-size slide

  14. ϑϨʔϜϫʔΫʹཔΒͳ͍
    » Ch. 10: Aspect-Oriented Programming by design
    » Ch. 11: Tool-based Aspect-Oriented Programming

    View full-size slide

  15. ϑϨʔϜϫʔΫʹཔΒͳ͍
    ʮͳΜ͔ΨνϟΨνϟΞϊςʔγϣϯ෇͚ͨΒ௚ͬͨʯͱ͍͏ࢥߟ͔Β
    ൈ͚ग़ͤͨɻ

    View full-size slide

  16. C#ͷຊͰͨ͠ʂ ͝ΊΜ
    ͳ͍͞ʂʂ

    View full-size slide