How dependency graph works in Koin or Kodein?

963 views Asked by At

I have Android/kotlin multi-module project. Some of my modules are Singletone, such as Network and Analytics modules. They need Application context in order to be initialized.

I am able to initialize Koin/Kodein in app module. However, the problem is how to inject application context into each module (since app module is not visible to Network/Analytics modules).

Basically, my app module is deoendent to other modules only.

As I recently started my project, I am evaluating Koin and Kodein to see which one is helping me the way I want. That's why I am open to switch them.

1

There are 1 answers

0
nyarian On

Here is no dependency graph built like in Dagger: no code generation, no reflection - all is just function-bound.

Application context is available through androidContext() method.

Modules mutual dependencies logic is described here.