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
mkeeda
October 27, 2023
Programming
0
89
手動DIの教訓
Cybozu Mobile Meetup 2023.10.27で登壇したLTのスライド資料です。
https://cybozu.connpass.com/event/299246/
mkeeda
October 27, 2023
Tweet
Share
More Decks by mkeeda
See All by mkeeda
WebViewと向き合う
mkeeda
1
700
お気に入りのAndroid Studio小技集
mkeeda
0
230
Scalable UI testing solutions かんたんまとめ
mkeeda
0
570
5分で分かるビルドロジック共通化の今
mkeeda
1
560
Compose で手に入れた UI の Unit test
mkeeda
2
1.1k
Jetpack Compose 完全に理解した
mkeeda
1
2.6k
5分でわかるCompose Modifiers deep dive
mkeeda
1
740
みんなで準備するスポンサー
mkeeda
0
180
What's new in Android development tools まとめ
mkeeda
0
1.3k
Other Decks in Programming
See All in Programming
禅の心を手に入れよ
eltociear
1
110
From Spring Boot 2 to Spring Boot 3 with Java 21 and Jakarta EE
ivargrimstad
0
140
GitHub Actionsで泣かないためにやっておきたい設定 / Recommended GHA settings to avoid crying
pinkumohikan
3
540
冗長なエラーログを削減し、スタックトレースを手に入れる / Reducing Verbose Error Logs and Obtaining Stack Traces
upamune
0
830
PostmanでAPIの動作確認が楽になった話
h455h1
0
170
MetricKitで予期せぬ終了を検知する話 / Detect unexpected termination with MetricKit
nekowen
1
190
Anthropic Cookbook のおすすめレシピ
schroneko
7
1k
ADRを一年運用してみた/adr_after_a_year
hanhan1978
7
2.4k
try! Swift Tokyo 初参加報告LT
hinakko2
0
220
VS Code をプロダクトにどう取り込むか
onomax
1
420
はてなにおける CSS Modules、及び CSS Modules に足りないもの / CSS Modules in Hatena, and CSS Modules missing parts
mizdra
7
940
Code Reviews
bkuhlmann
4
890
Featured
See All Featured
Designing Experiences People Love
moore
136
23k
Adopting Sorbet at Scale
ufuk
68
8.6k
Atom: Resistance is Futile
akmur
259
25k
Building an army of robots
kneath
300
41k
Building a Modern Day E-commerce SEO Strategy
aleyda
17
6.4k
Raft: Consensus for Rubyists
vanstee
132
6.3k
Build The Right Thing And Hit Your Dates
maggiecrowley
24
2k
From Idea to $5000 a Month in 5 Months
shpigford
377
45k
Typedesign – Prime Four
hannesfritz
36
2.1k
Learning to Love Humans: Emotional Interface Design
aarron
267
39k
What’s in a name? Adding method to the madness
productmarketing
PRO
16
2.6k
Become a Pro
speakerdeck
PRO
11
4.5k
Transcript
DI Cybozu Mobile Meetup 20 23 . 1 0 .
27 (@mr_mkeeda)
About me X/Twitter: @mr_mkeeda Github: @mkeeda Android Engineer at Cybozu,
Inc kintone AC 6 2
DI (Manual Dependency Injection) 3 rd perty DI 3 class
RemoteDataSource { // ... } class Repository( private val remoteDataSource: RemoteDataSource ) { // ... } class Component { private val remoteDataSource = RemoteDataSource() val repository = Repository(remoteDataSource) }
DI https://developer.android.com/training/dependency-injection/ manual 4
:app 5 Class A Class B
:app 6 Component B Class A Class B Component A
& & Class B
:app 7 SingletonComponent Class A Class B singleton Component A
Application &
:module-b :module-a 8 SingletonComponent Class A Class B singleton Component
A :shared
DI 9
:module-b :module-a 10 SingletonComponent Class A Class B singleton Component
A :shared
:module-b :shared :module-a 11 SingletonComponent Class A Class B singleton
Component A
:shared :module-a 12 SingletonComponent Class A C Component A :module-c
Class C Component C Class A singleton
:shared :module-a 13 SingletonComponent Class A C Component A :module-c
Class C Component C Class A singleton 🔄
14
:shared :module-a SingletonComponent Class A C Component A :module-c Class
C Component C Class A singleton 🔄 15 Component
:shared Interface Module B singleton :module-b :module-a 16 SingletonComponent Class
A Class B singleton Component A Class A singleton 🔄 Component
:module-b :shared :module-a 17 SingletonComponent Impl Class A Class B
singleton Component A Class A singleton Interface Module B singleton Component
DI 18 :module-b :app :module-a SingletonComponent Impl Class A Class
B singleton Component A :module-c Class C Component C Class A singleton Interface Module B singleton Interface Module A singleton SingletonComponent
DI Component lateinit, Type cast Component 19
DI Hilt Koin DI DI E 2 E 20
DI DI DI 21
22
kintone Android 1 . DI DI 2 . 23