Android-CleanArchitecture-Kotlin icon indicating copy to clipboard operation
Android-CleanArchitecture-Kotlin copied to clipboard

Why features are inside 'app' module?

Open RaggaJungler opened this issue 5 years ago • 2 comments

I've read article and definitely support an idea of modularization. Looking at the sample app I was wondering why don't move login and movies features into separate modules? From my point of view it makes intents about modularization even clearer. Could you @android10, please, share your thoughts about it? Which flaws do you see in such approach?

Thanks.

RaggaJungler avatar Feb 22 '20 22:02 RaggaJungler

Because distributed monolith pattern increases complexity compared to having them in app module.

If you have 30-40 screens, 1 module is totally OK. In fact that way you don't need to mess around with duplicate resources in different modules and the like.

Zhuinden avatar Feb 23 '20 09:02 Zhuinden

@Zhuinden Could you explain why you think it's distributed monolith? As for me it's more similar to microservices.

  1. I can reuse the same module inside different app.
  2. I can delete feature quite easily, just remove the module with this feature.

The only problem I can imagine is navigation. We can have a "main router" inside app module but this approach might not work starting from some scale.

RaggaJungler avatar Feb 23 '20 16:02 RaggaJungler