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
270
手動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
アジャイル & スクラム入門
mkeeda
0
94
そのAPI、誰のため? Androidライブラリ設計における利用者目線の実践テクニック
mkeeda
2
5.4k
Android StudioのAIコーディングツール、 ぶっちゃけどうなん???
mkeeda
0
460
DataStoreをテストする
mkeeda
0
550
時計仕掛けのCompose
mkeeda
1
490
What's new in Firebase for building gen AI features気になったところ
mkeeda
0
880
WebViewと向き合う
mkeeda
2
1.6k
お気に入りのAndroid Studio小技集
mkeeda
0
390
Scalable UI testing solutions かんたんまとめ
mkeeda
0
1.3k
Other Decks in Programming
See All in Programming
車輪の再発明をしよう!PHP で実装して学ぶ、Web サーバーの仕組みと HTTP の正体
h1r0
2
380
new(1.26) ← これすき / kamakura.go #8
utgwkk
0
2.7k
それはエンジニアリングの糧である:AI開発のためにAIのOSSを開発する現場より / It serves as fuel for engineering: insights from the field of developing open-source AI for AI development.
nrslib
1
510
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
590
Linux Kernelの1文字のミスで 権限昇格ができた話
rqda
0
2.1k
モックわからないマン卒業記 ~振る舞いを起点に見直した、フロントエンドテストにおけるモックの使いどころ~
tasukuwatanabe
3
420
The free-lunch guide to idea circularity
hollycummins
0
340
CS教育のDX AIによる育成の効率化
niftycorp
PRO
0
160
Goの型安全性で実現する複数プロダクトの権限管理
ishikawa_pro
2
1.3k
RailsのValidatesをSwift Macrosで再現してみた
hokuron
0
120
Java 21/25 Virtual Threads 소개
debop
0
260
Pythonデータ分析コトハジメinFukuoka
kanan
0
100
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.2k
Technical Leadership for Architectural Decision Making
baasie
3
300
Faster Mobile Websites
deanohume
310
31k
Balancing Empowerment & Direction
lara
5
960
The Limits of Empathy - UXLibs8
cassininazir
1
270
Ethics towards AI in product and experience design
skipperchong
2
240
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
0
460
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
410
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.1k
Raft: Consensus for Rubyists
vanstee
141
7.4k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
170
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