Hi Arnaud, thanks for replying, I’LL explain:
I have a Tree of coordinators (I am trying to implement the coordinators pattern) where each node in the tree gets passed a Dagger Component/Subcomponent. Actual implementation is using Dagger Component dependency. Each Coordinator node is associated with a Builder that receive the parent component, then creates a new component to be provided to the child Coordinator. The new created Coordinator keeps an instance of its own Component and when it spawn a new child Coordinator, it will use its own Component as the parent. So on and So forth. It is a minimal/manual implementation of Uber RIBs basically.
Now, I want to make the Builders/Coordinators independent of Dagger, so I could use any dependency injection solution out there. For that, I plan to abstract the Injection. But my main question is that, how I can create this per Coordiantor module/submodule or perhaps scope with Koin.
Coordinator Builder function:
https://github.com/pablichjenkov/MVVM-Coordinator/blob/fb853ab50ae7a8d9cdc91785955[…]in/java/com/intervalintl/onboard/OnboardCoordinatorBuilder.java
Coordinator Builder function usage:
https://github.com/pablichjenkov/MVVM-Coordinator/blob/fb853ab50ae7a8d9cdc91785955[…]/main/java/com/intervalintl/intro/IntroActivityCoordinator.java
The idea is to split the dependency graph into small subgraphs that are created on the fly as the App is browsed. To be able to scope dependencies of the Coordinator to each corresponding subgraph.