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

メンヘラコードをDIを使って駆逐する

 メンヘラコードをDIを使って駆逐する

tomoya-kamaji

May 22, 2022
Tweet

More Decks by tomoya-kamaji

Other Decks in Technology

Transcript

  1. (27)



    2018/4 Sier


    2021/6 Another works



    View full-size slide

  2. ෳۀΛ͍ͨ͠ਓͱෳۀਓࡐΛొ༻͍ͨ͠اۀ༷Λͭͳ͙
    ϚονϯάϓϥοτϑΥʔϜ
    ஥հख਺ྉͳ͠ɺఆֹͰ࠾༻͠์୊

    View full-size slide

  3. λεΫొ࿥Ϋϥε

    $SFBUF5BTL6TF$BTF

    .Z42-ʹӬଓԽ͢ΔΫϥε

    .Z4RM3FQPTJUPZ

    ͱ΋΍͘Μ
    ·͍ͪΌΜ
    ɾ·͍ͪΌΜͷมԽʹͱ΋΍͘Μ͕
    ɹӨڹΛड͚Δ
    ɾ·͍ͪΌΜʹґଘ͗ͯ͢͠ɺ·͍
    ɹͪΌΜ͔Β৐Γ׵͑ΒΕͳ͍
    ɾ%#ొ࿥ΫϥεͷมԽʹλεΫొ࿥Ϋϥε͕
    ɹӨڹΛड͚Δ
    ɾ.Z42-͔Β৐Γ׵͑ΒΕͳ͍

    View full-size slide

  4. ᶃ λεΫొ࿥͢ΔৼΔ෣͍Λද͍͕ͨ͠03.ͷ஌͕ࣝ͋ͬͯ
    ɹॲཧ͕ಡΈͮΒ͍
    ᶄ ಛఆͷ03.΍%#ʹґଘͨ͠ॲཧʹͳ͍ͬͯΔ

    View full-size slide

  5. ᶃ λεΫొ࿥͢ΔৼΔ෣͍Λද͍͕ͨ͠03.ͷ஌͕ࣝ͋ͬͯ
    ɹॲཧ͕ಡΈͮΒ͍
    ࢒ͬͨ໰୊
    ᶄ ಛఆͷ03.΍%#ʹґଘͨ͠ॲཧʹͳ͍ͬͯΔ
    ˠ.Z4RMͷ஌͕ࣝVTF$BTFʹ࿙Ε͍ͯΔ ґଘ͍ͯ͠Δ

    View full-size slide

  6. MySQL Radis

    MySQL

    View full-size slide

  7. Radis
    ଞʹӬଓԽઌ͕૿͑ͨΒɺɺɺ

    JGจ͕૿͑·͘Δ

    ௥Ճ๨Ε͕ൃੜ͢Δ
    λεΫొ࿥Ϋϥε

    $SFBUF5BTL6TF$BTF

    .Z4RM

    3FQPTJUPSZ
    3BEJT

    3FQPTJUPSZ
    ɺɺɺɺ

    View full-size slide

  8. λεΫొ࿥Ϋϥε

    $SFBUF5BTL6TF$BTF

    .Z4RM

    3FQPTJUPSZ
    3BEJT

    3FQPTJUPSZ
    ɺɺɺɺ
    *5BTL3FQPTJUPSZ

    *OUFSGBDF5BTL3FQPTJUPSZ

    MySqlReposity RadisRepsotory (interface)


    (DI)


    JG෼ذ͕ͳ͘ͳΔ
    ಛఆͷ%#ʹґଘ͠ͳ͍

    View full-size slide

  9. DI( )


    -


    - ( mock )




    - ( )


    - interface

    View full-size slide