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
110
手動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
What's new in Firebase for building gen AI features気になったところ
mkeeda
0
260
WebViewと向き合う
mkeeda
2
880
お気に入りのAndroid Studio小技集
mkeeda
0
260
Scalable UI testing solutions かんたんまとめ
mkeeda
0
760
5分で分かるビルドロジック共通化の今
mkeeda
1
760
Compose で手に入れた UI の Unit test
mkeeda
3
1.4k
Jetpack Compose 完全に理解した
mkeeda
1
2.9k
5分でわかるCompose Modifiers deep dive
mkeeda
1
820
みんなで準備するスポンサー
mkeeda
0
200
Other Decks in Programming
See All in Programming
HMSコンペ 11th Solution (team : kansai-kaggler)
t88
1
680
3 Effective Rules for Success with Signals in Angular
manfredsteyer
PRO
0
120
Composing an API the *right* way (Droidcon Berlin 2024)
zsmb
1
450
APIのない大学ログインWebサービスをWKWebViewとJavaScriptでアプリ化した話
akidon0000
1
330
スクラムマスターって孤独じゃないですか?
yoshitaroyoyo
1
140
CSC307 Lecture 13
javiergs
PRO
0
150
GraphQL はいいぞ! ~Laravel で学ぶ GraphQL 入門~
azuki
1
160
CSC307 Lecture 05
javiergs
PRO
0
210
Microservices rules (July 2024) : what good looks like
cer
PRO
0
1.6k
Play Billing Library 7.0.0 変更点まとめ@potatotips#88
kako351
0
160
みんなのオブザーバビリティプラットフォームを作ってるんだがパフォーマンスがやばい #mackerelio #srenext
ne_sachirou
0
370
【Go言語】ジェネリクス
tomo1227
0
170
Featured
See All Featured
Scaling GitHub
holman
458
140k
Rebuilding a faster, lazier Slack
samanthasiow
78
8.5k
Infographics Made Easy
chrislema
238
18k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
13
430
For a Future-Friendly Web
brad_frost
173
9.2k
YesSQL, Process and Tooling at Scale
rocio
166
14k
Unsuck your backbone
ammeep
666
57k
The Invisible Side of Design
smashingmag
294
50k
The Mythical Team-Month
searls
217
43k
The Brand Is Dead. Long Live the Brand.
mthomps
52
36k
Optimising Largest Contentful Paint
csswizardry
18
2.6k
A better future with KSS
kneath
231
17k
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