I am working on an e-commerce site. I am following clean architecture with MVVM and Dagger 2.But am getting stuck when we need to communicate in between modules, means i have to call some methods and class from one module another.
Actual scenario is - There is one separate module for cart and another for categories(consisting of products based on categories)
I have some set of APIs in cart module (ex. addToCart,fetch cartList,remove cart item etc.)which need to be call in both cart module and categories module(addToCart API need to call from categories module).
One way to do it as again writing same code in both module that will increase extra effort and also make both module dependent,thats violate clean architecture approach.
Can anybody suggest me best approach for this in clean architecture.