Hi Everyone, Have a doubt, but it is not related to kotlin, but generally any android app
I was reading some codes from github, and I found that each use case is written in a different class/File, I dont understand Why people are doing that, since i can write those as functions inside my repository class. Is that a good aproach to abstracting out the use cases seperately??
😶 2
âž• 1
s
Serge Shustov
07/15/2021, 7:56 AM
If you put everything in repository it will eventually grow into large and unreadable god object. Though separated use cases approach also has its difficulties, it's considered cleaner. And also check out clean architecture
K 2
n
Noushad Chullian
07/15/2021, 8:00 AM
Ahh... Okay Now I got your point... Thanks :-)
m
Mohit Sharma
07/15/2021, 11:32 AM
We took a mixed approach. We always start with one file, which will have our use cases, one we reaches max lines or max function we logically separate them into different file. This help us to solve both problem of readability and large number of file.