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
200
手動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
DataStoreをテストする
mkeeda
0
350
時計仕掛けのCompose
mkeeda
1
370
What's new in Firebase for building gen AI features気になったところ
mkeeda
0
650
WebViewと向き合う
mkeeda
2
1.3k
お気に入りのAndroid Studio小技集
mkeeda
0
340
Scalable UI testing solutions かんたんまとめ
mkeeda
0
1.1k
5分で分かるビルドロジック共通化の今
mkeeda
1
1.5k
Compose で手に入れた UI の Unit test
mkeeda
3
2k
Jetpack Compose 完全に理解した
mkeeda
1
3.7k
Other Decks in Programming
See All in Programming
List Unfolding - 'unfold' as the Computational Dual of 'fold', and how 'unfold' relates to 'iterate'"
philipschwarz
PRO
0
180
レガシーシステムの機能調査・開発におけるAI利活用
takuya_ohtonari
0
560
PT AI без купюр
v0lka
0
220
UPDATEがシステムを複雑にする? イミュータブルデータモデルのすすめ
shimomura
1
520
型付きアクターモデルがもたらす分散シミュレーションの未来
piyo7
0
730
イベントストーミングから始めるドメイン駆動設計
jgeem
4
790
データベースコネクションプール(DBCP)の変遷と理解
fujikawa8
1
230
KotlinConf 2025 現地で感じたServer-Side Kotlin
n_takehata
1
170
Javaのルールをねじ曲げろ!禁断の操作とその代償から学ぶメタプログラミング入門 / A Guide to Metaprogramming: Lessons from Forbidden Techniques and Their Price
nrslib
3
1.9k
Use Perl as Better Shell Script
karupanerura
0
680
AIにコードを生成するコードを作らせて、再現性を担保しよう! / Let AI generate code to ensure reproducibility
yamachu
7
6.2k
Haskell でアルゴリズムを抽象化する / 関数型言語で競技プログラミング
naoya
16
3.6k
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.3k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
14
1.5k
4 Signs Your Business is Dying
shpigford
183
22k
Optimizing for Happiness
mojombo
379
70k
Making the Leap to Tech Lead
cromwellryan
134
9.3k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Into the Great Unknown - MozCon
thekraken
39
1.8k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.8k
Intergalactic Javascript Robots from Outer Space
tanoku
271
27k
Building Flexible Design Systems
yeseniaperezcruz
328
39k
How to Ace a Technical Interview
jacobian
276
23k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
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