Dagger in Multi-Module SDK
Created by Ethan.Yoo
1. 최초 앱
APP
1. 최초 앱
APP
FeedManager
FeedActivity
LockscreenActivity
MainActivity AppManager
LockscreenManager
2. 대거 적용
APP
AppComponent
AppModule
2. 대거 적용
APP
FeedManager
AppModule
FeedActivity
LockscreenActivity
MainActivity App
AppComponent
AppManager
LockscreenManager
3. 피쳐 분리
APP
AppComponent
AppModule
APP
AppComponent
AppModule
Lockscreen
Component
Lockscreen
Module
Feed
Component
FeedModule
3. 피쳐 분리
APP
FeedManager
AppModule
FeedActivity
LockscreenActivity
MainActivity App
AppComponent AppManager
LockscreenManager
FeedModule
LockscreenModule
FeedComponent
Lockscreen
Component
4. Component vs Subcomponent
APP
App
Component
AppModule
Lockscreen
Lockscreen
Subcomponent
Lockscreen
Module
Feed
Feed
Subcomponent
FeedModule
APP
App
Component
AppModule
Lockscreen
Lockscreen
Component
Lockscreen
Module
Feed
Feed
Component
FeedModule
@Component.dependencies @Subcomponent
4. Component vs Subcomponent
APP
FeedManager
AppModule
FeedActivity
LockscreenActivity
MainActivity App
AppComponent AppManager
LockscreenManager
FeedModule
LockscreenModule
Feed
SubComponent
Lockscreen
Subcomponent
5. 모듈 분리
APP
AppComponent
AppModule
Lockscreen
Subcomponent
Lockscreen
Module
Feed
Subcomponent
FeedModule
APP
AppComponent
AppModule
Lockscreen
Lockscreen
Subcomponent
Lockscreen
Module
Feed
Feed
Subcomponent
FeedModule
Feed
Lockscreen
5. 모듈 분리
APP
FeedManager
AppModule
FeedActivity
LockscreenActivity
MainActivity App
AppComponent AppManager
LockscreenManager
FeedModule
LockscreenModule
Feed
Subcomponent
Lockscreen
Subcomponent
Feed
Lockscreen
5. 모듈 분리
APP
FeedManager
AppModule
FeedActivity
LockscreenActivity
MainActivity App
AppComponent AppManager
LockscreenManager
FeedModule
LockscreenModule
Feed
Subcomponent
Lockscreen
Subcomponent
5. Feature에서 App 접근
APP
AppComponent
AppModule
Lockscreen
Lockscreen
Component
Lockscreen
Module
APP
AppComponent
AppModule
Lockscreen
Lockscreen
Component
Lockscreen
Module
Lockscreen
Provider
Application :
LockscreenProvider
AndroidSDK
Application
Context
5. Feature에서 App 접근
APP Feed
Lockscreen
5. Feature에서 App 접근
APP
AppModule
LockscreenActivity
MainActivity App
AppComponent AppManager
LockscreenManager
LockscreenModule
Lockscreen
Component
Lockscreen
Provider
Feed
Lockscreen
5. Feature에서 App 접근
APP
FeedManager
AppModule
FeedActivity
LockscreenActivity
MainActivity App
AppComponent AppManager
LockscreenManager
FeedModule
LockscreenModule
FeedSubcomponent
Lockscreen
Subcomponent
FeedProvider
LockscreenProvider
6. Qualifier 공유
APP
App
Component
AppModule
Lockscreen
Lockscreen
Subcomponent
Lockscreen
Module
Feed
Feed
Subcomponent
FeedModule
Qualifiers
Qualifiers Qualifiers
6. Qualifier 공유
APP
App
Component
AppModule
Lockscreen
Lockscreen
Subcomponent
Lockscreen
Module
Feed
Feed
Subcomponent
FeedModule
DaggerBase
Qualifiers
Feed
Lockscreen
6. Qualifier 공유
APP
FeedManager
AppModule
FeedActivity
LockscreenActivity
MainActivity App
App
Component
AppManager
Lockscreen
Manager
FeedModule
Lockscreen
Module
Feed
Subcomponent
Lockscreen
Subcomponent
FeedProvider
Lockscreen
Provider
Dagger
Base
Qualifiers
7. Lib 분리
APP
App
Component
AppModule
Lockscreen
Lockscreen
Subcomponent
Lockscreen
Module
Feed
Feed
Subcomponent
FeedModule
DaggerBase
Qualifiers
Ad
AdModule
Feed Lockscreen
7. Lib 분리
APP
Feed
Manager
AppModule
FeedActivity LockscreenActivity
MainActivity App
App
Component
AppManager
Lockscreen
Manager
Feed
Module
Lockscreen
Module
Feed
Subcomponent
Lockscreen
Subcomponent
FeedProvider
Lockscreen
Provider
Ad
AdUseCase
AdModule
Dagger
Base
Qualifiers
8. Lib 간 참조
Lockscreen
Lockscreen
Subcomponent
Lockscreen
Module
Ad
AdModule
ApiClient
ApiClient
Module
Feed Lockscreen
8. Lib 간 참조
APP
Feed
Manager
AppModule
FeedActivity LockscreenActivity
MainActivity App
App
Component
AppManager
Lockscreen
Manager
Feed
Module
Lockscreen
Module
Feed
Subcomponent
Lockscreen
Subcomponent
FeedProvider
Lockscreen
Provider
Dagger
Base
Qualifiers
Ad
AdUseCase
AdModule
ApiClient
apiService
ApiClient
Module
Feed Lockscreen
8. Lib 간 참조
APP
Feed
Manager
AppModule
FeedActivity LockscreenActivity
MainActivity App
App
Component
AppManager
Lockscreen
Manager
Feed
Module
Lockscreen
Module
Feed
Subcomponent
Lockscreen
Subcomponent
FeedProvider
Lockscreen
Provider
Dagger
Base
Qualifiers
Ad
AdUseCase
AdModule
ApiClient
apiService
ApiClient
Module
Feed Lockscreen
8. Lib 간 참조
APP
Feed
Manager
AppModule
FeedActivity LockscreenActivity
MainActivity App
App
Component
AppManager
Lockscreen
Manager
Feed
Module
Lockscreen
Module
Feed
Subcomponent
Lockscreen
Subcomponent
FeedProvider
Lockscreen
Provider
Dagger
Base
Qualifiers
Ad
AdUseCase
AdModule
ApiClient
apiService
ApiClient
Module
9. SDK 분리
BuzzScreen
BuzzScreen
Component
BuzzScreen
Module
Lockscreen
Lockscreen
Subcomponent
Lockscreen
Module
Feed
Feed
Subcomponent
FeedModule
DaggerBase
Qualifiers
Ad
AdModule
APP
ApiClient
ApiClientModule
APP
Feed Lockscreen
9. SDK 분리
BuzzScreen
Feed
Manager
BuzzScreen
Module
FeedActivity LockscreenActivity
MainActivity
BuzzScreen
BuzzScreen
Component
BuzzScreen
Manager
Lockscreen
Manager
Feed
Module
Lockscreen
Module
Feed
Subcomponent
Lockscreen
Subcomponent
FeedProvider
Lockscreen
Provider
Dagger
Base
Qualifiers
Ad
AdUseCase
AdModule
ApiClient
apiService
ApiClient
Module
APP
Feed Lockscreen
9. SDK 분리
BuzzScreen
Feed
Manager
BuzzScreen
Module
FeedActivity LockscreenActivity
BuzzScreen
BuzzScreen
Component
BuzzScreen
Manager
Lockscreen
Manager
Feed
Module
Lockscreen
Module
Feed
Subcomponent
Lockscreen
Subcomponent
FeedProvider
Lockscreen
Provider
Dagger
Base
Qualifiers
Ad
AdUseCase
AdModule
ApiClient
apiService
ApiClient
Module
MainActivity
9. Feature모듈에서 SDK모듈 접근
APP
AppComponent
AppModule
Lockscreen
Lockscreen
Component
Lockscreen
Module
Lockscreen
Provider
Application :
LockscreenProvider
BuzzScreen
BuzzScreen
Component
BuzzScreen
Module
Lockscreen
Lockscreen
Component
Lockscreen
Module
Lockscreen
Provider
BuzzScreen :
LockscreenProvider
DaggerBase
Injections
AndroidSDK
Application
Context
9. Feature모듈에서 SDK모듈 접근
APP
Feed Lockscreen
9. Feature모듈에서 SDK모듈 접근
BuzzScreen
Feed
Manager
BuzzScreen
Module
FeedActivity LockscreenActivity
MainActivity
BuzzScreen
BuzzScreen
Component
BuzzScreen
Manager
Lockscreen
Manager
Feed
Module
Lockscreen
Module
Feed
Subcomponent
Lockscreen
Subcomponent
FeedProvider
Lockscreen
Provider
Dagger
Base
Qualifiers
Ad
AdUseCase
AdModule
ApiClient
apiService
ApiClient
Module
Injections
이상향
APP
BuzzScreen BuzzAdBenefit
Lockscreen Feed Interstitial
Ad Content
ApiClient
DaggerBase
Q & A
Q& A
Example : https://github.com/EthanYoo/DaggerMultiModule

Dagger in multi module sdk