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

オニオンアーキテクチャで Interfaceの認識が変わった話

オニオンアーキテクチャで Interfaceの認識が変わった話

2018.07.13 【非公式】PHPカンファレンス 2018 関西 前夜祭でお話ししたスライドです。 #phpkansai_eve

発表時に使ったサンプルプロジェクトはこちら : https://github.com/Ippey/practice-for-oa

Ippei Sumida

July 13, 2018
Tweet

More Decks by Ippei Sumida

Other Decks in Programming

Transcript

  1. ΦχΦϯΞʔΩςΫνϟͰ
    Interfaceͷೝ͕ࣝมΘͬͨ࿩
    2018.07.13 ʲඇެࣜʳPHPΧϯϑΝϨϯε 2018 ؔ੢ લ໷ࡇ

    View full-size slide

  2. # whoami
    - ֯ాɹҰฏʢ͢Έͩɹ͍ͬ΃͍ʣ

    - ϑϦʔϥϯε

    - Web Developer, App Developer

    - DDDֶशͩͨ͠͠ͱ͜Ζ

    View full-size slide

  3. What is “Onion Architecture”?

    View full-size slide

  4. UI
    Business Logic
    Data
    Infrastructure

    View full-size slide

  5. http://little-hands.hatenablog.com/entry/2017/10/04/231743

    View full-size slide

  6. What is “Unplat”?
    http://little-hands.hatenablog.com/entry/2017/10/04/231743

    View full-size slide

  7. Let’s try it in

    View full-size slide

  8. What is “Unplat”?
    Repository


    Service →
    ͜͏ґଘ͢ΔΜ͡Όͳ͍ʁ
    http://little-hands.hatenablog.com/entry/2017/10/04/231743

    View full-size slide

  9. ٙ໰ղܾʹ໾ཱͬͨ΋ͷ
    https://qiita.com/little_hand_s/items/2040fba15d90b93fc124
    ˍ

    View full-size slide

  10. What is “Unplat”?
    Repository


    Service →
    ͬͪ͜Ͱ࣮૷
    RepositoryInterface →
    I/Fʹґଘ
    http://little-hands.hatenablog.com/entry/2017/10/04/231743

    View full-size slide

  11. ͋ΔػೳΛอূ͢ΔͨΊͷInterface
    ͋ΔػೳͷΈར༻ͤ͞ΔͨΊͷInterface
    ͡ͿΜͷதͷInterface

    View full-size slide

  12. ॻ͍ͯΔॻ੶
    ʻɹͬͪ͜ͷ͕͍͍Αʂ

    View full-size slide

  13. ࣮ࡍͷίʔυͰ

    View full-size slide

  14. ݸਓతײ૝
    • Interfaceͷߟ͑ํ͕มΘͬͨ

    • ςετ࡞Γ΍ͦ͢͏

    • ଞͷ͜ͱʹ΋Ԡ༻Ͱ͖ͦ͏

    • Ͱ΋ɺ͜ͷ࢖͍ํ͕͋ͬͯΔ͔Α͘Θ͔ΒΜ

    View full-size slide