You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's a few of things I am having a hard time figuring out using VIPER architecture:
If I have an entity that is just a data structure, and I have a presenter which is responsible for formatting data, why would I not want to pass the entity from interactor to presenter? I find myself unnecessarily creating two separate data structures (one on the interactor/entity side and one on the presenter side) which the interactor does a 1 to 1 mapping on. Is this correct?
How does data get passed from one module to the next? Let's say I have a module that lists categories and a module that lists items in a category. When a user selects a category, that selections needs to be passed from the category module to the item module so that the item module interactor knows which category to retrieve. Data should be owned by the interactors, yet the transition between modules happens at the presenter/wireframe level. It seems I am stuck passing data from one interactor to another through their respective presenters/wireframes which results in a lot of unnecessary code and seems to violate the single responsibility of the presenter only presenting data to a view and a wireframe just transitioning between views. Should the interactors in different modules know about each other? What's the best way to pass data between modules?
Related to last question. How should wireframes interact with the rest of the module? Should wireframes know about interactors? If so, this would seem to make the passing of information easier between them. Should wireframes be responsible for instantiating their entire module? In the VIPER ToDo list, most all of the instantiation and configuration happens in a separate class called AppDependencies and the wireframes don't seem to know at all about interactors. In a much larger app with many more modules, I imagine AppDependencies becoming a bit of a nightmare as well as the issue of instantiating a lot of objects well before you need them.
Thanks!
The text was updated successfully, but these errors were encountered:
Here's a few of things I am having a hard time figuring out using VIPER architecture:
If I have an entity that is just a data structure, and I have a presenter which is responsible for formatting data, why would I not want to pass the entity from interactor to presenter? I find myself unnecessarily creating two separate data structures (one on the interactor/entity side and one on the presenter side) which the interactor does a 1 to 1 mapping on. Is this correct?
How does data get passed from one module to the next? Let's say I have a module that lists categories and a module that lists items in a category. When a user selects a category, that selections needs to be passed from the category module to the item module so that the item module interactor knows which category to retrieve. Data should be owned by the interactors, yet the transition between modules happens at the presenter/wireframe level. It seems I am stuck passing data from one interactor to another through their respective presenters/wireframes which results in a lot of unnecessary code and seems to violate the single responsibility of the presenter only presenting data to a view and a wireframe just transitioning between views. Should the interactors in different modules know about each other? What's the best way to pass data between modules?
Related to last question. How should wireframes interact with the rest of the module? Should wireframes know about interactors? If so, this would seem to make the passing of information easier between them. Should wireframes be responsible for instantiating their entire module? In the VIPER ToDo list, most all of the instantiation and configuration happens in a separate class called AppDependencies and the wireframes don't seem to know at all about interactors. In a much larger app with many more modules, I imagine AppDependencies becoming a bit of a nightmare as well as the issue of instantiating a lot of objects well before you need them.
Thanks!
The text was updated successfully, but these errors were encountered: