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
florent
06/23/2023, 2:38 PM
Easy define a new data class
t
tankistorep
06/27/2023, 3:19 PM
A new data class with exactly the same fields?
f
florent
06/27/2023, 3:48 PM
Yes
t
tankistorep
06/28/2023, 10:27 AM
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
florent
06/28/2023, 10:30 AM
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