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
Understanding Dagger2 Part1
Search
FujiKinaga
November 20, 2018
Programming
80
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.5k
最新のCompose Multiplatform を使うとiOSとAndroidアプリはどれくらい作れるのか
fujikinaga
2
730
Androidのテストの理解を深めてみた
fujikinaga
0
77
開発案件の進み方
fujikinaga
0
130
深いい勉強会 vol.10
fujikinaga
0
110
深いい勉強会 vol.9
fujikinaga
0
130
Mater of Subscription
fujikinaga
0
92
深いい勉強会
fujikinaga
2
95
深いい勉強会 The Navigation Component
fujikinaga
0
84
Other Decks in Programming
See All in Programming
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
340
UPDATE をやめる — EF Core でマスタをバージョン管理する
panda728
PRO
0
600
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.2k
Security issues being discussed on Web Platforms
petamoriken
0
1.2k
海上で動くGoサーバー: goroutineとchannelでさばく航行データストリーム
atsuki_seo
0
920
GitHubハンズオン講座 — 実務レベルのチーム開発のフローを身につけよう
junhat6
0
100
App Storeの外へ──日本のiOSサイドローディング入門 for iOSDC Japan 2026
yuukiw00w
0
240
Jetpack Compose メカニズム
skydoves
0
470
AgentCore CLI で進化した AWS での AI エージェントの作り方 : 必要な機能を必要な時に
icoxfog417
PRO
3
380
アクセシビリティから考える情報設計
high_g_engineer
0
400
難しいけど、読めた。- OSSの入口に立った話。
sts11142
0
120
TiDB Cloudのカスタムコントローラーによるオートスケール対応
takaidohigasi
0
130
Featured
See All Featured
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
480
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.6k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
610
A Tale of Four Properties
chriscoyier
163
24k
Balancing Empowerment & Direction
lara
6
1.3k
Being A Developer After 40
akosma
91
590k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.6k
Rails Girls Zürich Keynote
gr2m
96
14k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
770
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.4k
Site-Speed That Sticks
csswizardry
13
1.5k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
300
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.