Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VIPER Issues #10

Open
scottrhoyt opened this issue Dec 4, 2014 · 0 comments
Open

VIPER Issues #10

scottrhoyt opened this issue Dec 4, 2014 · 0 comments

Comments

@scottrhoyt
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant