$30 off During Our Annual Pro Sale. View Details »
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
62
【Go言語】クロージャ
tomo1227
0
280
【Go言語】イテレータ
tomo1227
0
76
【Go言語】エラーハンドリング
tomo1227
0
66
AIに淘汰されないようにするには?
tomo1227
0
67
【Go言語】range
tomo1227
0
72
【Go言語】break
tomo1227
0
66
Other Decks in Programming
See All in Programming
C-Shared Buildで突破するAI Agent バックテストの壁
po3rin
0
390
從冷知識到漏洞,你不懂的 Web,駭客懂 - Huli @ WebConf Taiwan 2025
aszx87410
2
2.7k
LLM Çağında Backend Olmak: 10 Milyon Prompt'u Milisaniyede Sorgulamak
selcukusta
0
120
WebRTC、 綺麗に見るか滑らかに見るか
sublimer
1
190
開発に寄りそう自動テストの実現
goyoki
2
1k
【Streamlit x Snowflake】データ基盤からアプリ開発・AI活用まで、すべてをSnowflake内で実現
ayumu_yamaguchi
1
120
20 years of Symfony, what's next?
fabpot
2
360
AIコーディングエージェント(NotebookLM)
kondai24
0
200
非同期処理の迷宮を抜ける: 初学者がつまづく構造的な原因
pd1xx
1
720
なあ兄弟、 余白の意味を考えてから UI実装してくれ!
ktcryomm
11
11k
Claude Codeの「Compacting Conversation」を体感50%減! CLAUDE.md + 8 Skills で挑むコンテキスト管理術
kmurahama
0
280
Integrating WordPress and Symfony
alexandresalome
0
160
Featured
See All Featured
Scaling GitHub
holman
464
140k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Balancing Empowerment & Direction
lara
5
800
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.3k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.7k
Context Engineering - Making Every Token Count
addyosmani
9
520
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.3k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.1k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.2k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.3k
Transcript
Tomoki Ota υϥ🔵ΜͰ%*
υϥ🔵ΜͰDI υϥ🔵ΜͰґଘੑٯసͷݪଇ ΞδΣϯμ
DI
ͷ🟡ଠυϥ🔵Μʹґଘ ͷ🟡ଠυϥ🔵Μͷ͜ͱΛ ୭ʹ૬ஊ͠ͳ͍ͷͰɺ୭ υϥ͑Μ͕ؔΘ͍ͬͯΔ͜ ͱΛΓ·ͤΜɻ ґଘੑͷೖ ʙDI͍ͯ͠ͳ͍ঢ়ଶʙ
ͷ🟡ଠυϥ🔵Μʹґଘ ͷ🟡ଠυϥ🔵Μͷ͜ͱΛ ଞͷਓʹ૬ஊ͠·ͨ͠ɻ ґଘੑͷೖ ʙDIͨ͠ঢ়ଶʙ ೖͱݺͿ
໌ࣔతʹपΓʹԿΛඞཁͱ͢Δ͔ એݴ͢Δ͜ͱ ڱٛͷDI
ٛͷDI ґଘੑͷೖɺϦείϑͷஔݪଇɺAdatpterύλʔϯɺ CompositeύλʔϯͳͲ͋ΒΏΔύλʔϯͷू·Γɻ ίʔυΛૄ݁߹ʹͯ͠ɺอक༰қੑΛ্ͤ͞Δ
DI͔ͨ͠Βґଘੑͳ͘ͳΔ → ґଘੑແ͘ͳΓ·ͤΜ Α͋͘Δޡղ
DI͔ͨ͠ΒςετͰϞοΫͰ͖Δ → Ͱ͖Δ߹ͱͰ͖ͳ͍߹͕͋Δ Α͋͘Δޡղ
ςετͰ͖Δྫ ೖ
ςετͰ͖Δྫ ӈͷςετ
ςετͰ͖ͳ͍ྫ
DIͱςετ நతͳͷʹґଘ͍ͯ͠ΕɺDIͨ͠ ͚ͩͰςετͰ͖Δɻ ۩ମʹґଘ͍ͯ͠Δ߹ɺDIͯ͠ς ετͰ͖ͳ͍ɻ
ґଘੑٯసͷݪଇ
ґଘੑٯస ʙٯస͍ͯ͠ͳ͍ঢ়ଶʙ υϥ🔵Μ͕ͷ🟡ଠʹґଘ
ґଘੑٯస υϥ🔵Μͱͷ🟡ଠ͕ɺ࢛࣍⚪ϙέοτʹґଘ
ґଘੑٯస υϥ🔵Μ͕ɺͷ🟡ଠ(ͷ🟡ଠͱ࢛࣍⚪ϙέοτ)ʹґଘ ʙٯసͨ͠ঢ়ଶʙ
ґଘੑͷೖ ࢛࣍⚪ϙέοτ͑͋͞Εɺυ🟠ϛͰ͍͍
·ͱΊ ۩ମ͔Βநґଘͤ͞Δ͜ͱͰɺґଘੑΛ ٯస͢Δ͜ͱ͕Ͱ͖Δɻ → ςετ͕͘͢͠ͳΔ → Γସ͕͑͘͢͠ͳΔ