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

beter feature package organisation #55

Open ooCHURIoo opened 6 years ago

ooCHURIoo commented 6 years ago

The actual feature package (login or movies) contain all class of the feature. I think it doesn't reflect the "clean architecture" responsability split.

I know it's a sample project but like you say in the blog post :

Code/package organization is one of the key factors of a good architecture

I think feature package should at least contain the folowing packages :

crjacinro commented 6 years ago

The high level package organization should be based on its features (login / movies) However, in my opinion, it would be ok also to use presentation, domain, data directories, inside those feature packages.

aaghan commented 4 years ago

what I am doing is, put everything in core package with other utils required in a different module.

Just do not create daggerComponent for it

the module shall be included by all other modules.

now every module can be distinguished with respect to feature.

Edger commented 1 year ago

I think to have 3 tiers package of Clean Architecture is a better practice, just like this:

And if we have some common usecases or model beans, then we could construct a common package which is at the same level with feature packages to contains them, as followed:

Feature package code can use code in common package, in this way, we can make our code cohesive and reusable as best as we can.