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
90
手動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
580
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
Node.js v22 で変わること
yosuke_furukawa
PRO
11
3.9k
サイコロで理解する統計的仮説検定の考え方
tatamiya
4
1k
ADRを一年運用してみた/adr_after_a_year
hanhan1978
7
2.4k
Going beyond Apache Parquet's default settings
xhochy
0
120
Scalable Customer Journey Orchestration (CJO)
lewuathe
0
400
Behind VS Code Extensions for JavaScript / TypeScript Linnting and Formatting
unvalley
5
1.1k
初心者のためのRubyKaigi入門/RubyKaigi Introduction
a_matsuda
8
1.3k
Elm 0.19.0 Changes
bkuhlmann
0
490
R言語の環境構築と基礎 Tokyo.R 112
bob3bob3
0
270
try!Swift Tokyo 2024 参加報告 LT
akidon0000
1
230
CREってこういうこと? 体験入社 - 提案資料 - / what-is-cre-trial-employment
shinden
0
250
if constexpr文はテンプレート世界のラムダ式である
faithandbrave
3
670
Featured
See All Featured
The Brand Is Dead. Long Live the Brand.
mthomps
49
29k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
222
21k
Six Lessons from altMBA
skipperchong
22
3k
Optimising Largest Contentful Paint
csswizardry
12
2.4k
Designing Experiences People Love
moore
136
23k
Optimizing for Happiness
mojombo
370
69k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
11
1k
The MySQL Ecosystem @ GitHub 2015
samlambert
244
12k
Principles of Awesome APIs and How to Build Them.
keavy
121
16k
What’s in a name? Adding method to the madness
productmarketing
PRO
17
2.7k
We Have a Design System, Now What?
morganepeng
44
6.8k
Building Your Own Lightsaber
phodgson
100
5.7k
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