Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ドラ🔵もんでDIを学ぶ
Search
Tomoki Ota
June 21, 2024
Programming
0
5.7k
ドラ🔵もんでDIを学ぶ
ドラ🔵もんでDIと依存性逆転の注入を解説します。
コードの例など詳細な解説は以下で行なっています。
ドラ🔵もんで依存性の注入と依存性逆転の原則を理解する!!
Tomoki Ota
June 21, 2024
Tweet
Share
More Decks by Tomoki Ota
See All by Tomoki Ota
アーキテクチャの価値
tomo1227
0
100
アーキテクチャとビジネスロジック
tomo1227
0
100
【Go言語】テスト
tomo1227
0
61
【Go言語】クロージャ
tomo1227
0
280
【Go言語】イテレータ
tomo1227
0
75
【Go言語】エラーハンドリング
tomo1227
0
65
AIに淘汰されないようにするには?
tomo1227
0
66
【Go言語】range
tomo1227
0
71
【Go言語】break
tomo1227
0
66
Other Decks in Programming
See All in Programming
tsgolintはいかにしてtypescript-goの非公開APIを呼び出しているのか
syumai
6
2.2k
Developing static sites with Ruby
okuramasafumi
0
290
組み合わせ爆発にのまれない - 責務分割 x テスト
halhorn
1
150
著者と進める!『AIと個人開発したくなったらまずCursorで要件定義だ!』
yasunacoffee
0
140
【Streamlit x Snowflake】データ基盤からアプリ開発・AI活用まで、すべてをSnowflake内で実現
ayumu_yamaguchi
1
120
AtCoder Conference 2025「LLM時代のAHC」
imjk
2
480
Tinkerbellから学ぶ、Podで DHCPをリッスンする手法
tomokon
0
130
Microservices rules: What good looks like
cer
PRO
0
1.4k
Socio-Technical Evolution: Growing an Architecture and Its Organization for Fast Flow
cer
PRO
0
340
20 years of Symfony, what's next?
fabpot
2
360
なあ兄弟、 余白の意味を考えてから UI実装してくれ!
ktcryomm
11
11k
実はマルチモーダルだった。ブラウザの組み込みAI🧠でWebの未来を感じてみよう #jsfes #gemini
n0bisuke2
2
1k
Featured
See All Featured
Building an army of robots
kneath
306
46k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.6k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
Balancing Empowerment & Direction
lara
5
800
How to train your dragon (web standard)
notwaldorf
97
6.4k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
1
100
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
Practical Orchestrator
shlominoach
190
11k
Six Lessons from altMBA
skipperchong
29
4.1k
The Invisible Side of Design
smashingmag
302
51k
A designer walks into a library…
pauljervisheath
210
24k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Transcript
Tomoki Ota υϥ🔵ΜͰ%*
υϥ🔵ΜͰDI υϥ🔵ΜͰґଘੑٯసͷݪଇ ΞδΣϯμ
DI
ͷ🟡ଠυϥ🔵Μʹґଘ ͷ🟡ଠυϥ🔵Μͷ͜ͱΛ ୭ʹ૬ஊ͠ͳ͍ͷͰɺ୭ υϥ͑Μ͕ؔΘ͍ͬͯΔ͜ ͱΛΓ·ͤΜɻ ґଘੑͷೖ ʙDI͍ͯ͠ͳ͍ঢ়ଶʙ
ͷ🟡ଠυϥ🔵Μʹґଘ ͷ🟡ଠυϥ🔵Μͷ͜ͱΛ ଞͷਓʹ૬ஊ͠·ͨ͠ɻ ґଘੑͷೖ ʙDIͨ͠ঢ়ଶʙ ೖͱݺͿ
໌ࣔతʹपΓʹԿΛඞཁͱ͢Δ͔ એݴ͢Δ͜ͱ ڱٛͷDI
ٛͷDI ґଘੑͷೖɺϦείϑͷஔݪଇɺAdatpterύλʔϯɺ CompositeύλʔϯͳͲ͋ΒΏΔύλʔϯͷू·Γɻ ίʔυΛૄ݁߹ʹͯ͠ɺอक༰қੑΛ্ͤ͞Δ
DI͔ͨ͠Βґଘੑͳ͘ͳΔ → ґଘੑແ͘ͳΓ·ͤΜ Α͋͘Δޡղ
DI͔ͨ͠ΒςετͰϞοΫͰ͖Δ → Ͱ͖Δ߹ͱͰ͖ͳ͍߹͕͋Δ Α͋͘Δޡղ
ςετͰ͖Δྫ ೖ
ςετͰ͖Δྫ ӈͷςετ
ςετͰ͖ͳ͍ྫ
DIͱςετ நతͳͷʹґଘ͍ͯ͠ΕɺDIͨ͠ ͚ͩͰςετͰ͖Δɻ ۩ମʹґଘ͍ͯ͠Δ߹ɺDIͯ͠ς ετͰ͖ͳ͍ɻ
ґଘੑٯసͷݪଇ
ґଘੑٯస ʙٯస͍ͯ͠ͳ͍ঢ়ଶʙ υϥ🔵Μ͕ͷ🟡ଠʹґଘ
ґଘੑٯస υϥ🔵Μͱͷ🟡ଠ͕ɺ࢛࣍⚪ϙέοτʹґଘ
ґଘੑٯస υϥ🔵Μ͕ɺͷ🟡ଠ(ͷ🟡ଠͱ࢛࣍⚪ϙέοτ)ʹґଘ ʙٯసͨ͠ঢ়ଶʙ
ґଘੑͷೖ ࢛࣍⚪ϙέοτ͑͋͞Εɺυ🟠ϛͰ͍͍
·ͱΊ ۩ମ͔Βநґଘͤ͞Δ͜ͱͰɺґଘੑΛ ٯస͢Δ͜ͱ͕Ͱ͖Δɻ → ςετ͕͘͢͠ͳΔ → Γସ͕͑͘͢͠ͳΔ