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
手動DIの教訓
Search
mkeeda
October 27, 2023
Programming
320
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
手動DIの教訓
Cybozu Mobile Meetup 2023.10.27で登壇したLTのスライド資料です。
https://cybozu.connpass.com/event/299246/
mkeeda
October 27, 2023
More Decks by mkeeda
See All by mkeeda
Google I/O 2026 個人的に気になりトピック
mkeeda
0
36
アジャイル & スクラム入門
mkeeda
0
260
そのAPI、誰のため? Androidライブラリ設計における利用者目線の実践テクニック
mkeeda
2
5.6k
Android StudioのAIコーディングツール、 ぶっちゃけどうなん???
mkeeda
0
680
DataStoreをテストする
mkeeda
0
620
時計仕掛けのCompose
mkeeda
1
590
What's new in Firebase for building gen AI features気になったところ
mkeeda
0
1k
WebViewと向き合う
mkeeda
2
1.7k
お気に入りのAndroid Studio小技集
mkeeda
0
420
Other Decks in Programming
See All in Programming
技術的負債を組織課題として解く-増えすぎたマイクロサービスとの戦い-
reimaru
1
2k
Are APIs Still Relevant in the AI Era?
soyuka
0
260
GKE で Pod の見方を変えたら、スケールアウト時の挙動を真に捉えられた話
stkk
0
130
Java 27新機能 / Java 27 new features
kishida
2
150
モジュールの視点からSwiftを読み解く #iosdc
s_shimotori
0
180
Go × SIMDで高速化するベクトル検索 ~ルーフラインモデルでSIMDが効く境界を探れ! ~
po3rin
1
1.8k
XP祭りでしか伝わらないフリップネタ #xpjug
murabayashi
0
150
XHTMLが残したもの
yosuke_furukawa
PRO
2
810
Omarchy Tokyo やると聞いて UMPC 買ってセットアップしてきた
mtsmfm
0
150
AHC070解法紹介
eijirou
0
120
What We Talk About When We Talk About XP
m_seki
2
650
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
170
Featured
See All Featured
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
700
Deep Space Network (abreviated)
tonyrice
0
310
We Are The Robots
honzajavorek
0
380
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
Site-Speed That Sticks
csswizardry
13
1.5k
Designing for Timeless Needs
cassininazir
1
480
The Cult of Friendly URLs
andyhume
79
7k
Designing Experiences People Love
moore
143
24k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
260
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
Thoughts on Productivity
jonyablonski
76
5.4k
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