Hey guys, I need advice here. Let’s imagine an an...
# koin-contributors
p
Hey guys, I need advice here. Let’s imagine an android app with hundreds of features. Each feature has one or multiple activities with you N fragments. Each host activity has your Koin module with scope tied to activity. What approach is better? 1. load and unload these activity tied koin modules in each activity host; 2. load and unload these activity tied koin modules in Application class; I think the second option it’s easy to maintain because host activities didn’t care with Koin load/unload and the tied scope can solve this in runtime. But… I don’t know if this case will be less performatic then first option.
m
I would go with option 2. It is easier to maintain (and also to validate in unit tests the graph). I would only do option 1 if I have numbers to prove the performance is significant enough for my app's graph, and it would payoff the additional maintenance cost...
🤝 1
a
why load/unload modules if you use scopes?
p
I thought it would be lighter to load/unload modules in activity than doing this at application level. 😅