This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | methods fields package/class name | |
| ... | |
| 39 7 com.sherryyuan.diexamples.dagger | |
| 29 8 com.sherryyuan.diexamples.kodein | |
| 19 8 com.sherryyuan.diexamples.koin | |
| 202 54 dagger | |
| 94 23 dagger.android | |
| 2 0 dagger.android.internal | |
| 96 31 dagger.internal | |
| 4 0 dagger.multibindings | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | @Provides | |
| // provides a Door | |
| fun provideDoor(): Door = SlidingDoorImpl() | |
| @Provides | |
| // provides a SlidingDoorImpl, not a plain Door! | |
| fun provideDoor() = SlidingDoorImpl() | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | @Module | |
| class TestDaggerModule { | |
| @Provides | |
| fun providesHouse(door: Door): DaggerHouse = mock() | |
| @Provides | |
| fun providesDoor() : Door = DoorImpl() | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | class MainApplication : Application(), KoinComponent, KodeinAware { | |
| override val kodein = Kodein { | |
| import(kodeinModule) | |
| } | |
| @Inject | |
| lateinit var daggerHouse: DaggerHouse | |
| val koinStreet by inject<KoinStreet>() | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | class MainApplication : Application(), KodeinAware { | |
| override val kodein = Kodein { | |
| import(kodeinModule) | |
| } | |
| val kodeinHouse by instance<KodeinHouse>() | |
| override fun onCreate() { | |
| super.onCreate() | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | val kodeinModule = Kodein.Module(name = "kodeinModule") { | |
| bind<KodeinHouse>() with provider { KodeinHouse() } | |
| bind<Door>() with provider { DoorImpl() } | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | class KodeinHouse : KodeinAware { | |
| override val kodein = Kodein { | |
| import(kodeinModule) | |
| } | |
| val door by instance<Door>() | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | class MainApplication : KoinComponent { | |
| val koinHouse by inject<KoinHouse>() | |
| override fun onCreate() { | |
| super.onCreate() | |
| startKoin { | |
| modules(koinModule) | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | val koinModule = module { | |
| factory { KoinHouse() } | |
| factory { DoorImpl() as Door } | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | class KoinHouse : KoinComponent { | |
| val door by inject<Door>() | |
| } | 
NewerOlder