Introduction
This repo is try to find the different usage injection dependency between dagger
and hilt
. The been spilited by serveral test cases to let us know better about the detail of DI. Each Test case
have a specific branch. All screenshots is from this slide
Test cases
Case 1 Use ActivityComponent to inject two activity(no scope)
- branch case 1
Case 2 Test case 2. Use ActivityComponent to inject two activity (scope @PerActivity)
- branch case 2
Case 3 Test case 3. Use AppComponent to inject two activity (no scope)
- branch case 3
Case 4 Test case 4. Use AppComponent to inject two activity (scope @Singleton)
- branch case 4
Case 4.1 Test case 4.1. Use AppComponent to inject two activity (scope @Singleton)
- branch case 4.1
Case 5 (compare hilt usage Test case 5. Use @InstallIn(ActivityComponent::class) to inject two activity(no scope))
- branch case 5
Case 5.1 Test case 5.1. Use @InstallIn(ActivityComponent::class) to inject two activity(@ActivityScope)
- branch case 5.1