Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
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
96
アーキテクチャとビジネスロジック
tomo1227
0
95
【Go言語】テスト
tomo1227
0
55
【Go言語】クロージャ
tomo1227
0
270
【Go言語】イテレータ
tomo1227
0
72
【Go言語】エラーハンドリング
tomo1227
0
61
AIに淘汰されないようにするには?
tomo1227
0
60
【Go言語】range
tomo1227
0
66
【Go言語】break
tomo1227
0
63
Other Decks in Programming
See All in Programming
オンデバイスAIとXcode
ryodeveloper
0
450
KoogではじめるAIエージェント開発
hiroaki404
1
440
イベントストーミングのはじめかた / Getting Started with Event Storming
nrslib
1
340
The Missing Link in Angular's Signal Story: Resource API and httpResource
manfredsteyer
PRO
0
110
ノーコードからの脱出 -地獄のデスロード- / Escape from Base44
keisuke69
0
680
What’s Fair is FAIR: A Decentralised Future for WordPress Distribution
rmccue
0
160
Core MIDI を勉強して作曲用の電子ピアノ作ってみた!
hypebeans
0
110
Tangible Code
chobishiba
3
530
詳細の決定を遅らせつつ実装を早くする
shimabox
1
1k
「10分以内に機能を消せる状態」 の実現のためにやっていること
togishima
1
270
AIエージェントでのJava開発がはかどるMCPをAIを使って開発してみた / java mcp for jjug
kishida
4
400
Blazing Fast UI Development with Compose Hot Reload (droidcon London 2025)
zsmb
0
500
Featured
See All Featured
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.3k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
31
2.7k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
118
20k
Writing Fast Ruby
sferik
630
62k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.2k
For a Future-Friendly Web
brad_frost
180
10k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Balancing Empowerment & Direction
lara
5
740
Typedesign – Prime Four
hannesfritz
42
2.9k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.6k
Transcript
Tomoki Ota υϥ🔵ΜͰ%*
υϥ🔵ΜͰDI υϥ🔵ΜͰґଘੑٯసͷݪଇ ΞδΣϯμ
DI
ͷ🟡ଠυϥ🔵Μʹґଘ ͷ🟡ଠυϥ🔵Μͷ͜ͱΛ ୭ʹ૬ஊ͠ͳ͍ͷͰɺ୭ υϥ͑Μ͕ؔΘ͍ͬͯΔ͜ ͱΛΓ·ͤΜɻ ґଘੑͷೖ ʙDI͍ͯ͠ͳ͍ঢ়ଶʙ
ͷ🟡ଠυϥ🔵Μʹґଘ ͷ🟡ଠυϥ🔵Μͷ͜ͱΛ ଞͷਓʹ૬ஊ͠·ͨ͠ɻ ґଘੑͷೖ ʙDIͨ͠ঢ়ଶʙ ೖͱݺͿ
໌ࣔతʹपΓʹԿΛඞཁͱ͢Δ͔ એݴ͢Δ͜ͱ ڱٛͷDI
ٛͷDI ґଘੑͷೖɺϦείϑͷஔݪଇɺAdatpterύλʔϯɺ CompositeύλʔϯͳͲ͋ΒΏΔύλʔϯͷू·Γɻ ίʔυΛૄ݁߹ʹͯ͠ɺอक༰қੑΛ্ͤ͞Δ
DI͔ͨ͠Βґଘੑͳ͘ͳΔ → ґଘੑແ͘ͳΓ·ͤΜ Α͋͘Δޡղ
DI͔ͨ͠ΒςετͰϞοΫͰ͖Δ → Ͱ͖Δ߹ͱͰ͖ͳ͍߹͕͋Δ Α͋͘Δޡղ
ςετͰ͖Δྫ ೖ
ςετͰ͖Δྫ ӈͷςετ
ςετͰ͖ͳ͍ྫ
DIͱςετ நతͳͷʹґଘ͍ͯ͠ΕɺDIͨ͠ ͚ͩͰςετͰ͖Δɻ ۩ମʹґଘ͍ͯ͠Δ߹ɺDIͯ͠ς ετͰ͖ͳ͍ɻ
ґଘੑٯసͷݪଇ
ґଘੑٯస ʙٯస͍ͯ͠ͳ͍ঢ়ଶʙ υϥ🔵Μ͕ͷ🟡ଠʹґଘ
ґଘੑٯస υϥ🔵Μͱͷ🟡ଠ͕ɺ࢛࣍⚪ϙέοτʹґଘ
ґଘੑٯస υϥ🔵Μ͕ɺͷ🟡ଠ(ͷ🟡ଠͱ࢛࣍⚪ϙέοτ)ʹґଘ ʙٯసͨ͠ঢ়ଶʙ
ґଘੑͷೖ ࢛࣍⚪ϙέοτ͑͋͞Εɺυ🟠ϛͰ͍͍
·ͱΊ ۩ମ͔Βநґଘͤ͞Δ͜ͱͰɺґଘੑΛ ٯస͢Δ͜ͱ͕Ͱ͖Δɻ → ςετ͕͘͢͠ͳΔ → Γସ͕͑͘͢͠ͳΔ