Hey all! For anyone familiar with the multi-module...
# android-architecture
t
Hey all! For anyone familiar with the multi-module architecture, I have a problem where I have the following modules:
Copy code
navigation -> feature -> domain
And I need
navigation
to access a data class defined in
domain
, but I don’t want there to be a direct dependency (as I don’t want navigation to have access to use cases etc). The only way I can think of solving this is creating something like a
type
module which both the domain and navigation modules depend on. Is there another easier/better practice way of doing this?
f
Easy define a new data class
t
A new data class with exactly the same fields?
f
Yes
t
I’m not sure if that scales well - if you need to “duplicate” same data class in 3 or more modules, changing it in the original module will cause the need for changes in all other modules
f
The purpose of the two data class isn't the same so it makes sense to have two. At the moment they have the same fields but that's a coincidence, in the future it is more probable that they will be different as they have different roles
t
I see, fair enough! Thanks for the help 🙂