Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
ドラ🔵もんでDIを学ぶ
Search
Tomoki Ota
June 21, 2024
Programming
6k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ドラ🔵もんでDIを学ぶ
ドラ🔵もんでDIと依存性逆転の注入を解説します。
コードの例など詳細な解説は以下で行なっています。
ドラ🔵もんで依存性の注入と依存性逆転の原則を理解する!!
Tomoki Ota
June 21, 2024
More Decks by Tomoki Ota
See All by Tomoki Ota
アーキテクチャの価値
tomo1227
0
130
アーキテクチャとビジネスロジック
tomo1227
0
130
【Go言語】テスト
tomo1227
0
100
【Go言語】クロージャ
tomo1227
0
360
【Go言語】イテレータ
tomo1227
0
130
【Go言語】エラーハンドリング
tomo1227
0
110
AIに淘汰されないようにするには?
tomo1227
0
110
【Go言語】range
tomo1227
0
110
【Go言語】break
tomo1227
0
110
Other Decks in Programming
See All in Programming
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
5
740
Simple Storage Service(S3) is not simple
iwatsukayura
0
230
mrbgem 三角測量 開発
ogom
0
220
WebRTC映像をAirPlayに対応させる挑戦.pdf
monolithic_adam
0
350
Turning Architecture into Unit Tests in the AI Era (NSSpain XIV)
steliosf
PRO
1
130
The Rails Doctrine Decade
koic
2
530
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
570
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
270
wkhtmltopdfの次どうするか問題2026
willnet
2
1.9k
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
260
Domain-Driven Transformation
hschwentner
2
2.3k
月間100万人のサービス刷新で、 技術選定をHonoに振り切った話
yutobara
8
5.6k
Featured
See All Featured
Done Done
chrislema
187
17k
The SEO Collaboration Effect
kristinabergwall1
1
590
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.6k
First, design no harm
axbom
PRO
2
1.3k
sira's awesome portfolio website redesign presentation
elsirapls
0
450
Paper Plane
katiecoart
PRO
4
54k
Un-Boring Meetings
codingconduct
0
440
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
550
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
620
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
930
Transcript
Tomoki Ota υϥ🔵ΜͰ%*
υϥ🔵ΜͰDI υϥ🔵ΜͰґଘੑٯసͷݪଇ ΞδΣϯμ
DI
ͷ🟡ଠυϥ🔵Μʹґଘ ͷ🟡ଠυϥ🔵Μͷ͜ͱΛ ୭ʹ૬ஊ͠ͳ͍ͷͰɺ୭ υϥ͑Μ͕ؔΘ͍ͬͯΔ͜ ͱΛΓ·ͤΜɻ ґଘੑͷೖ ʙDI͍ͯ͠ͳ͍ঢ়ଶʙ
ͷ🟡ଠυϥ🔵Μʹґଘ ͷ🟡ଠυϥ🔵Μͷ͜ͱΛ ଞͷਓʹ૬ஊ͠·ͨ͠ɻ ґଘੑͷೖ ʙDIͨ͠ঢ়ଶʙ ೖͱݺͿ
໌ࣔతʹपΓʹԿΛඞཁͱ͢Δ͔ એݴ͢Δ͜ͱ ڱٛͷDI
ٛͷDI ґଘੑͷೖɺϦείϑͷஔݪଇɺAdatpterύλʔϯɺ CompositeύλʔϯͳͲ͋ΒΏΔύλʔϯͷू·Γɻ ίʔυΛૄ݁߹ʹͯ͠ɺอक༰қੑΛ্ͤ͞Δ
DI͔ͨ͠Βґଘੑͳ͘ͳΔ → ґଘੑແ͘ͳΓ·ͤΜ Α͋͘Δޡղ
DI͔ͨ͠ΒςετͰϞοΫͰ͖Δ → Ͱ͖Δ߹ͱͰ͖ͳ͍߹͕͋Δ Α͋͘Δޡղ
ςετͰ͖Δྫ ೖ
ςετͰ͖Δྫ ӈͷςετ
ςετͰ͖ͳ͍ྫ
DIͱςετ நతͳͷʹґଘ͍ͯ͠ΕɺDIͨ͠ ͚ͩͰςετͰ͖Δɻ ۩ମʹґଘ͍ͯ͠Δ߹ɺDIͯ͠ς ετͰ͖ͳ͍ɻ
ґଘੑٯసͷݪଇ
ґଘੑٯస ʙٯస͍ͯ͠ͳ͍ঢ়ଶʙ υϥ🔵Μ͕ͷ🟡ଠʹґଘ
ґଘੑٯస υϥ🔵Μͱͷ🟡ଠ͕ɺ࢛࣍⚪ϙέοτʹґଘ
ґଘੑٯస υϥ🔵Μ͕ɺͷ🟡ଠ(ͷ🟡ଠͱ࢛࣍⚪ϙέοτ)ʹґଘ ʙٯసͨ͠ঢ়ଶʙ
ґଘੑͷೖ ࢛࣍⚪ϙέοτ͑͋͞Εɺυ🟠ϛͰ͍͍
·ͱΊ ۩ମ͔Βநґଘͤ͞Δ͜ͱͰɺґଘੑΛ ٯస͢Δ͜ͱ͕Ͱ͖Δɻ → ςετ͕͘͢͠ͳΔ → Γସ͕͑͘͢͠ͳΔ