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
Understanding Dagger2 Part1
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
FujiKinaga
November 20, 2018
Programming
69
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Understanding Dagger2 Part1
FujiKinaga
November 20, 2018
More Decks by FujiKinaga
See All by FujiKinaga
Flutterで実装する実践的な攻撃対策とセキュリティ向上
fujikinaga
2
1.3k
最新のCompose Multiplatform を使うとiOSとAndroidアプリはどれくらい作れるのか
fujikinaga
2
710
Androidのテストの理解を深めてみた
fujikinaga
0
74
開発案件の進み方
fujikinaga
0
120
深いい勉強会 vol.10
fujikinaga
0
100
深いい勉強会 vol.9
fujikinaga
0
120
Mater of Subscription
fujikinaga
0
85
深いい勉強会
fujikinaga
2
88
深いい勉強会 The Navigation Component
fujikinaga
0
78
Other Decks in Programming
See All in Programming
Vite+ Unified Toolchain for the Web
naokihaba
0
150
IBM Bobを活用したレガシーアプリの最新化
oniak3ibm
PRO
1
180
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.6k
The ROI of Quarkus for Spring Boot Applications
hollycummins
0
100
AIチームを指揮するOSS「TAKT」活用術 / How to Use “TAKT,” an OSS Tool for Orchestrating AI Teams
nrslib
6
850
Composerを使ったサプライチェーン攻撃の様子を眺めてみる #phpstudy
o0h
PRO
2
240
TSKaigi Night Talks 2026_TypeScriptでサプライチェーンの整合性を型に閉じ込める
geekplus_tech
0
330
net-httpのHTTP/2対応について
naruse
0
460
Lessons from Spec-Driven Development
simas
PRO
0
150
Spec Driven Development | AI Summit Lisbon
danielsogl
PRO
0
170
AIとRubyの静的型付け
ukin0k0
0
550
「エンジニアインターン、どうやって取った?」準備のリアルを語るLT会 Progate BAR
akiomatic
0
120
Featured
See All Featured
How to Think Like a Performance Engineer
csswizardry
28
2.6k
Between Models and Reality
mayunak
4
330
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
Navigating Team Friction
lara
192
16k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
New Earth Scene 8
popppiees
3
2.3k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
390
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
190
Reality Check: Gamification 10 Years Later
codingconduct
0
2.2k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.5k
Documentation Writing (for coders)
carmenintech
77
5.4k
Mind Mapping
helmedeiros
PRO
1
240
Transcript
Understanding Dagger2 ਂ͍͍ษڧձ#8 Fuji
What’s Dagger2, why use it? • DI (Dependency Injection) Library
• Easy to test • Manage Lifecycle • Module sharing, reusing, replacing • Auto code generating with annotation • Ikeike, Cool, Kacchoiiiiiiiiiii
Կ͕ศརʁ • ଞͷΫϥεͷґଘؔΛݮΒͤΔͨΊɺΫϥε͝ ͱͷςετΛॻ͖͘͢ͳΔ • ͍·Θ͍ͨ͠ΠϯελϯεΛ؆୯ʹఆٛͰ͖Δ& ҰݩཧͰ͖Δ • ϘΠϥʔϓϨʔτͳίʔυΛݮΒͤΔ •
ContextΛߦّͷྑ͍ํ๏Ͱ֤ΫϥεʹͤΔ
Constitution • @Inject - ϑΟʔϧυσʔλίϯετϥΫλʹ͚ΔͱରΦϒδΣΫτΛnew͠ͳͯ͘ injectΛݺΜͩλΠϛϯάͰউखʹ࡞ͬͯ͘ΕΔ • Module - new
͍ͨ͠ͷΛఆ͓ٛͯ͘͠ͱ͜Ζ • Component - ֤Moduleಉ࢜ΛͲͷΑ͏ʹඥ͚(ґଘ)ͤ͞Δ͔Λఆٛ͢Δͷ - Moduleಉ͕࢜ࢠؔͱͳΓɺࢠͷModuleࢀরͰ͖Δ • Scope - ComponentΛͲΕ͘Β͍ͷؒੜଘͤ͞Δ͔Λཧ͢Δͷ
Component & Module & Scope
͞Βʹࡉ͔͘ʂ
Jake͞ΜͷεϥΠυ͕Θ͔Γ ͍͢ͷͰҠಈʂ
Ͳ͏͍͏෩ʹΦϒδΣΫτ͕ ΠϯδΣΫτ͞Ε͍ͯ͘ͷ͔
͏গ͠ࡉ͔͘ʂ
Jake͞ΜͷεϥΠυ͕Θ͔Γ ͍͢ͷͰҠಈύʔτ2ʂ
طଘͷnanaͷDaggerͷ ΈΑΓͬͱྑ͍ํ๏Λߟ ͑ͯΈΔ
ͬͱྑ͍ํ๏Ҋ • Dagger.android֦ுΛͬͯ͞ΒʹϘΠϥʔϓϨʔτίʔ υΛݮΒ͍ͯ͘͠ • ActivityComponent/ModuleͱFragmentComponent/ ModuleΛ͞Βʹݫີʹཧ͢Δ - MainActivityModuleɺSetupActivityModuleɺ RecordActivityModuleͳͲ
- RepositoryΫϥε(SwaggerͷΧςΰϦͷཻ)ͱಉ͡ྖҬ Ͱ͚ͨΓͯ͠ྑͦ͞͏
࣮ࡍʹॻ͍ͯΈͨ
ଓ͘ɻ (Ϗϧυ௨ͬͨ)
References • Dagger2 ೖղઆ - https://qiita.com/MoyuruAizawa/items/ 26cb093adbc778013467 • Dependency Injection
with Dagger2 - https://jakewharton.com/dependency-injection-with-dagger-2/ • Dagger Android֦ுͷ͍ํ - https://medium.com/@star_zero/dagger- android%E6%8B%A1%E5%BC%B5%E3%81%AE%E4%BD%BF %E3%81%84%E6%96%B9-6527dcb74531
Next Steps • Helping Dagger Help You - https://jakewharton.com/helping-dagger-help-you/ •
Dagger2 - Subcomponent vs dependencies - http://yuki312.blogspot.com/2016/02/android- dagger2-subcomponent-vs.html • Dagger2 - MultibindingͰComponentΛ៉ྷʹ্͛Δ - http://yuki312.blogspot.com/2017/02/dagger2- multibindingcomponent.html
Fin.