Giter VIP home page Giter VIP logo

viper-todo's Issues

Lazy Loading Images Strategy

I'd be interested to hear how lazy loading images in a tableview would be approached in this architecture? I noticed cellForRowAtIndexPath is placed in the view class, does this mean one should:

  1. Keep a reference to the image URL or ID in the view model (violation of the rules?)
    This could then be passed back to the presenter, who could pass it to the interactor, who could pass it to the data manager, along with a completion block to display the image in the cell once it has been loaded?
  2. Keep an array of NSManagedObjects (presumably in the datastore) and pass back the indexPath.row, with a similar completion block as above?

Would be great to hear any thoughts.

Retain cycles

Everything in the VIPER TODO example is using strong references.

  • View controllers is strongly referenced by the Wireframes.
  • Presenters are strongly referenced by the View controllers.
  • View controllers are strongly referenced by the Presenters.
  • And so on.

Unless i'm missing something this will result in nothing being released from memory. Is this behaviour intended?

I we are allocating all the dependancies, wireframes, presenters, etc in the app delegate how does this scale to a large application. Is there room in this architecture for lazy initialisation?

Passing data from One screen to another

Hey Guys, could you please add an update to the current TODO demo showing how to pass data from one screen to another. For example, when the user selects a TODO, showing that selected ToDo on a ToDoDetailViewController. This will give us a much needed understanding of how we can accomplish such stuff by making correct use of VIPER architecture.

Thanks a lot

VIPER Issues

Sorry to repost here, but figured this would be better than the ObjCIO Github.

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? Also, if you need to modify an entity based off of user interactions, how do you do this without violating layer boundaries and passing some reference to the entity to the presenter and/or view? The only other option seems to be an ugly remapping in the interactor.

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. There is also the layer boundary issue again because if you pass enough information for the second interactor to interact with the entity, then you are basically passing the entity... that or you have to do another ugly remapping the in second interactor. Should the interactors in different modules know about each other or communicate via a protocol? What's the best way to pass data between modules?

And what is the proper role of wireframes? Shouldn't they instantiate the entire stack (presenter, interactor, etc.) for their module and wire them up? Seems like this is mostly happening in the AppDependencies class which feels like it will get out of hand quickly. If wireframes own and configure the entire stack, then it feels like this might help a bit in passing information from one interactor to another, but would still violate boundaries or require interactors to communicate.

Editing entities

As the managed objects should not cross the data manager boundary my question would be: When I would want to edit one single todo item, I only have the reference to the entity. How would you establish the connection to the corresponding managed object. I imagine holding the object id within the entity could be one solution. How do you manage this at mutualmobile?

//cc @cnstoll @jeffgilbert

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.