-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[kmp] Replace Dagger-Hilt with Koin #215
Comments
Hi @Kaaveh |
Hey @hadi-norouzi |
Hi @Kaaveh I've created a Koin module for each module and upper layer modules includes lower modules in their modules like this: database module: val localModule = module {
single { Database() }
} remote module: val apiModule = module {
single { Api() }
} repository module: val repositoryModule = module {
single { Repository(get(), get())
} I think we need to change the |
This will violate the CLEAN arch. The implementation of the domain layer must be agnostic to the data layer. |
Yeah we could achieve these by change direction of dependency. now is: We could move repository interface to the repository module and only export that interface to domain module. and change dependencies like this: I think because of |
What do you think @VahidGarousi ? |
@Kaaveh I need a day to review and respond |
Hey @hadi-norouzi |
Do you agree with me if we want to provides each dependencies in each module we need to have val localModule = module {
single { Database() }
}
val apiModule = module {
single { Api() }
} and upper layers should first include lower module and after that provides their dependencies like this: val repositoryModule = module {
include(localModule, apiModule)
single { Repository(local = get(), api = get())
} So repository module needs to import local and api modules. Another solutionWe could import domain and data modules in app module and in startKoin {
modules(dataModule, domainModule)
} |
@hadi-norouzi |
I was looking for this issue to help if it is pending on something. I have a suggestion for your problem. Put your Koin modules into feature modules. Each feature module depends on core domain and also data modules, which give us reference to our needed classes. With such an arrangement, you can access modules in the app module to include them in the startKoin scope of the |
I think it's due to the support for larger screens. It needs refactoring soon. |
@hadi-norouzi |
We can refactor multi-screens using the new |
Ya, Currently I'm working on refactoring the whole project in the next few days. |
Yes, you are right. It's the solution. |
Hey @hadi-norouzi , |
Replace Dagger-Hilt with Koin
The text was updated successfully, but these errors were encountered: