Hi Everyone, Have a doubt, but it is not related t...
# android
n
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
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
Ahh... Okay Now I got your point... Thanks :-)
m
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.
👌 1
K 1