Upgrade to Pro — share decks privately, control downloads, hide ads and more …

M-VC to MVC road

M-VC to MVC road

Avatar for Maksim Bazarov

Maksim Bazarov

November 20, 2016

Other Decks in Programming

Transcript

  1. Long road to MVC* *MVC a.k.a MVP, IVC, VIPER, VICR,

    SOLID, Clean… Bonial International GmbH Maksim Bazarov @maksbazarov | [email protected]
  2. CLEAN *MVC a.k.a MVP, IVC, VIPER, VICR, SOLID, Clean… SO

    LID M VC VIPER VIC R VIP D RY BD D M M VP VIC R VIP TD SO LID M M VP VIPER VIC R VIP M VVM D RY TD D BD D SO LID M VC VP VIPER P M VVM D RY TD D BD D M VP M VVM TD S VIC R M VVM TD D VIPER BUZZWORD
  3. WRONG! Controller — ViewController View — UIView Model — DTO|

    DataModel | DomainModel Routing — Navigation
  4. Building Module Routing / Navigating Passing data to the next

    module Implementing module interface Prepare data for presenting / Formatting Dispatch / Handle Events from user Business logic Interacting with data / services Converting / preparing data Access data layer Layouting Getting events Every screen has to do:
  5. Building Module Routing / Navigating Passing data to the next

    module Implementing module interface Prepare data for presenting / Formatting Dispatch / Handle Events from user Business logic Interacting with data / services Converting / preparing data Access data layer Layouting Getting events STEP 1: VIPER
  6. Wireframe Building Module Routing / Navigating Passing data to the

    next module Implementing module interface Prepare data for presenting / Formatting Dispatch / Handle Events from user Business logic Interacting with data / services Converting / preparing data Access data layer Layouting Getting events
  7. Wireframe Building Module Routing / Navigating Passing data to the

    next module Implementing module interface Prepare data for presenting / Formatting Dispatch / Handle Events from user Business logic Interacting with data / services Converting / preparing data Access data layer Layouting Getting events Presenter
  8. Wireframe Building Module Routing / Navigating Passing data to the

    next module Implementing module interface Prepare data for presenting / Formatting Dispatch / Handle Events from user Business logic Interacting with data / services Converting / preparing data Access data layer Layouting Getting events Presenter Interactor
  9. Wireframe Building Module Routing / Navigating Passing data to the

    next module Implementing module interface Prepare data for presenting / Formatting Dispatch / Handle Events from user Business logic Interacting with data / services Converting / preparing data Access data layer Layouting Getting events Presenter Interactor Data manager
  10. Wireframe Building Module Routing / Navigating Passing data to the

    next module Implementing module interface Prepare data for presenting / Formatting Dispatch / Handle Events from user Business logic Interacting with data / services Converting / preparing data Access data layer Layouting Getting events Presenter Interactor Data manager Services
  11. Wireframe Building Module Routing / Navigating Passing data to the

    next module Implementing module interface Prepare data for presenting / Formatting Dispatch / Handle Events from user Business logic Interacting with data / services Converting / preparing data Access data layer Layouting Getting events Presenter Interactor Data manager View Services
  12. View Services Data manager Interactor Presenter Wireframe Building Module Routing

    / Navigating Passing data to the next module Implementing module interface Prepare data for presenting / Formatting Dispatch / Handle Events from user Business logic Interacting with data / services Converting / preparing data Access data layer Layouting Getting events ows Owning scheme
  13. VIPER MODULE Assembly Router View Services Data manager Interactor Presenter

    Wireframe Building Module Routing / Navigating Passing data to the next module Implementing module interface Prepare data for presenting / Formatting Dispatch / Handle Events from user Business logic Interacting with data / services Converting / preparing data Access data layer Layouting Getting events VIPER V2 RETAIN CYCLE
  14. VIPER MODULE Assembly Router View Services Data manager Interactor Presenter

    Wireframe Building Module Routing / Navigating Passing data to the next module Implementing module interface Prepare data for presenting / Formatting Dispatch / Handle Events from user Business logic Interacting with data / services Converting / preparing data Access data layer Layouting Getting events VIPER V3 Now view strongly owned by UIKit View owns wireframe Wireframe owns rest module
  15. VIPER MODULE Assembly Router View Services Data manager Interactor Presenter

    Controller Building Module Routing / Navigating Passing data to the next module Implementing module interface Prepare data for presenting / Formatting Dispatch / Handle Events from user Business logic Interacting with data / services Converting / preparing data Access data layer Layouting Getting events VIPER V4
  16. VIPER MODULE Data Source VIPER V4 Router View Services Interactor

    Presenter Controller Routing / Navigating Passing data to the next module Implementing module interface Prepare data for presenting / Formatting Dispatch / Handle Events from user Business logic Interacting with data / services Layouting Getting events Assembly Building Module Provides a data
  17. VIPER MODULE Data Source VICR (no viper anymore) Router View

    Services Interactor Controller Routing / Navigating Passing data to the next module Implementing module interface Dispatch / Handle Events from user Business logic Interacting with data / services Layouting Getting events Assembly Building Module *can contain components
  18. MVC

  19. MVC Router Routing / Navigating Passing data to the next

    module + Interactor Business logic Interacting with data / services ~ Assembly