Hello, let's say we have 3 modules: domain, data a...
# koin
g
Hello, let's say we have 3 modules: domain, data and app. App depends on data and domain, data depends on domain, domain has no dependencies on other project modules. I create repository interface in domain module and implementation in data module, but remember that domain module doesn't depend on data module. I managed to do it with hilt: https://github.com/gufeczek/dagger-ioc-test/tree/main Is it possible to do it with koin, preferable with annotations?
1
p
Hi @gufeczek as far as I know you can you can use https://insert-koin.io/docs/reference/koin-android/modules-android/ inlcudes in normal DSL and in annotations https://insert-koin.io/docs/reference/koin-android/modules-android/
g
@Pedro Alberto I think this doesn't concern my problem. To include data module in my domain module I would need to have dependency on data module in my domain build.gradle file. What I want to achieve is to not depend on other projects modules in my domain module. It's possible in hilt but I'm not sure it's possible with koin.
i
I think that you can do it with the same structure you did in your example with Hilt. The repository implementation and the Module for Koin should be on the data module. What problem are you facing?
👍 4
g
@IgnacioCarrion Thank you, it works now. I tried to define class with @Module annotation in domain, but it's not needed.
i
@gufeczek I'm glad you made it work!
❤️ 1