Onion-like app architecture

Onion-like app architecture

Learn how to architect an entire app – from UI, through user / data flows and transactions down to data storage and delivery – in independent, interchangeable layers. With layers that can be freely combined as needed, with no or minimal disruption to the rest of app. Just like an onion. You will learn that MVC is excellent, if employed properly. You will learn how to use Coordinators without delegates and with truly minimal UIKit extensions. Learn about an approach suitable for iOS teams of one and teams of 1000 developers. For 5 screen apps and for 200+ UIViewController behemots.

https://github.com/radianttap/Coordinator

https://github.com/radianttap/Spotifier

Video: https://www.youtube.com/watch?v=kD8dRvEQ5II

Transcript

  1. Aleksandar Vacić @radiantav O N I O N - L

    I K E A P P A R C H I T E C T U R E App Builders 2019
  2. Aleksandar Vacić Belgrade, Serbia radianttap.com aplus.rs @radiantav

  3. Why architecture? architecture?

  4. HomeController ProductDetailsController ProductsController

  5. None
  6. Architecture of complex apps is ever evolving, quite often in

    unforseen ways.
  7. None
  8. Fashion SPORTS BETTING Sales

  9. · 100+ screens (few dozen are multi-screen flows) · multiple

    external services · 10+ languages (with runtime updates) · 20+ markets in Europe, Africa and S. America · iOS, tvOS, watchOS, widgets · Notifications, deep links, home screen actions SPORTS BETTING · Unpredictable future expansion
  10. Connect to web services Import into local storage Cache temporary

    data Directly target any screen, at any depth Transform any 3rd party data model into my own Multi-screen user flow Multi-service data flow Multi-OS reusability Reading data is always super performant c h a l l e n g e s
  11. Build complex system that works by first building a simple

    system that works. Break complex, multi-faceted flows into self-sufficient steps. Then compose them back. p r i n c i p l e s
  12. DATA MODEL

  13. Data Source Data Delivery Data Storage DATA MODEL

  14. Data Source Data Delivery Data Storage web service, bundled file,

    cached download URLSession, FileManager, Authentication, Encryption Core Data, mobile db, in-memory, file / custom store
  15. Data UI

  16. Data UI

  17. Data UI

  18. None
  19. Data UI

  20. Data UI

  21. Data UI

  22. UI Data

  23. UI Data

  24. Data UI UI Coordinators

  25. UI UI Coordinators Data

  26. UI UI Coordinators Middleware Data

  27. Data Source Data Delivery Data Storage UI UI Coordinators Middleware

    L A Y E R S DATA MODEL
  28. O N I O N It resembles , isn’t it?

  29. O N I O N G A R L I

    C It resembles , isn’t it?
  30. Data Source Data Delivery Data Storage UI UI Coordinators Middleware

    L A Y E R E D DATA MODEL KEEP IT & SIMPLE
  31. Coordinator
 Advanced implementation of said pattern in Swift, including care-free

    messaging through UIResponder chain. Avenue
 URLSession wrapper, handles boilerplate, enables seamless usage with Operation(Queue). Ambar
 Custom Core Data stack with automatic merge of background imports into main MOC. / radianttap
  32. DEMO radianttap / Spotifier /

  33. What were my problems, or… KILS Architecture Benefits Builds on

    system frameworks ɠ Rapid iterations ɡ Painless refactoring ɢ Low maintenance cost ɣ
  34. / radianttap SpeakerDeck.com / radianttap aplus.rs Aleksandar Vacić, radianttap.com @radiantav

    SLIDES DEV BLOG CONTACT