Hi, Im splitting my app into multiple modules and ...
# announcements
v
Hi, Im splitting my app into multiple modules and im having some trouble with enums. I have 3 modules (network, database, repository). They all have their own data entity classes that use enums for certain fields (for example verificationStatus in the server response would be an enum). Should I have separate enums in each layer or should I share one class between all 3? Right now im having the enums only in the repository layer but im not sure if thats the best way
p
Have you tried breaking things down by functional area rather than layer? There might end up being a few things that go into a common module. Personally, I’ve found that modules tend to be a little more cleanly separated once I split them in that direction.
v
I split it layer first and maybe I will split functionally later (this is the approach recommended by google) it doesnt make a whole lot of sense to only split functionally because then you end up with every module relying on every dependency
ie: nearly every module would need room and retrofit instead of just the network or db modules
b
I gave up with copying objects from layer to layer. In my apps the data objects are the objects that every layer uses… except for when it’s turned into a response for an API call, like a JSON response to a REST api.