I've been working on a personal project so to better understand the VIPER architecture. I really like the way I can keep modules separated, making the code cleaner.
I still have some doubts when it comes to modules dependencies:
I have one module responsible to show some statistics based on user's data and another module responsible to show some data projections based on statistics.
My ProjectionsInteractor then, needs to take some data from the StatisticsInteractor, as I don't want to reimplement the same stuff twice.
I already have a DataManager layer, that is basically a CoreDataManager, but there isn't any logic there. It's just used by the Interactors to retrieve and manipulate some data without knowing anything about the Persistence details.
Where do I put commonality factored out from multiple interactors? Does it make a difference:
- whether the commonality is related to the core {data-store, networking, sensors} data-acquisition/storage purpose of interactors versus
- whether the commonality is related to business rules to be enforced on that data acquired from {data-store, networking, sensors}?