android10 / Android-CleanArchitecture-Kotlin

This is a movies sample app in Kotlin, which is part of a serie of blog posts I have written about architecting android application using different approaches.
https://fernandocejas.com/2018/05/07/architecting-android-reloaded/
4.69k stars 935 forks source link

Why features are inside 'app' module? #88

Open RaggaJungler opened 4 years ago

RaggaJungler commented 4 years ago

I've read article and definitely support an idea of modularization. Looking at the sample app I was wondering why don't move loginand moviesfeatures 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.

Zhuinden commented 4 years ago

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.

RaggaJungler commented 4 years ago

@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.