Hello! I'm developing a feature with Koin as DI an...
# koin-contributors
g
Hello! I'm developing a feature with Koin as DI and here we are using some clean architecture concepts, so I've got a doubt. We have one module per Fragment to provide their dependencies, one module to the Data layer, and another to the Domain layer. In this way, to share the dependencies from the domain and data layers with the fragments (presentation layer), do I need to use the "shared module" approach or only the "module includes" as shown in the Koin doc? I'm asking, because when I was reading the documentation about shared modules, I got confused if shared modules could be the best approach to sharing dependencies.
p
I think this part of doc is talking about optimization and not about sharing modules. Can you help us clarify this point, @arnaud.giuliani?
a
I see yes, it's quite confusing. The simplest way to reuse modules is to use
includes
function from the DSL. Up to you to find the right granularity in terms of number of Koin modules.
this way of
sharedModule
was in some first versions of KMP (seems outdated then)
g
I found some typos, so I did a fork and opened a pull request with fixes. PR Link: https://github.com/InsertKoinIO/koin/pull/1670
1
p
Reviewed and approved
👊 1
a
thans @Gustavo Barbosa Barreto @Pedro Francisco de Sousa Neto, I will take a look 👍
👍 1
g
@arnaud.giuliani, I'll open other PR with suggestion to avoid these doubts, considering your explanation. 👊 Thanks for your help.
👍 3