Save 37% off PRO during our Black Friday Sale! »

Arch Patterns in Android

Arch Patterns in Android

Presented online at GDG Kolkata (https://youtu.be/h6g0T7CQbcY).
This presentation talks about Architecture patterns in android, and how to migrate from MVP to MVVM etc.

36c29634c5d55eae66224c24ba2b933c?s=128

Rivu Chakraborty

April 12, 2020
Tweet

Transcript

  1. Arch Patterns in Android GDG Kolkata Rivu Chakraborty https://www.rivu.dev 1

  2. Rivu Chakraborty Sr. Software Engineer - BYJU’S https://rivu.dev Tech Author,

    Tech Speaker, Android Dev, Kotlin Advocate 2
  3. Arch Patterns in Android 3

  4. Architecture What is an Architecture 4

  5. What’s an Architecture? An Architecture is a Code structure /

    collection of principles / patterns, that helps better organise code in a project for easy maintenance and future changes. It also enables you to have efficient test case coverages. 5
  6. Architecture Where does it come from? What Patterns / Principles

    6
  7. SOLID Principles 7

  8. Every class should have a Single Responsibility Single-Responsibility 8

  9. Entities Should be Open for Extension, Closed for Modification Open-Closed

    9
  10. Let Φ(x) be a property provable about objects x of

    type T. Then Φ(y) should be true for objects y of type S where S is a subtype of T. Liskov Substitution 10
  11. Clients should not be forced to depend upon interfaces that

    they do not use. Interface Segregation 11
  12. A class that uses a dependency, shouldn’t create / know

    how to create that dependency Depencency Inversion (IoC) 12
  13. Layers In an usual Android App 13

  14. data presentation ui domain (?) cache remote

  15. data presentation ui

  16. data 16 Repository LocalDataStore RemoteDataStore AppService / ApiService DB

  17. presentation & ui 17 MVP MVI MVVM MvRx mobius

  18. Architecture Patterns 18

  19. MVP 19 View Interface Contract Presenter Interface tight coupling

  20. MVVM 20 ViewModel

  21. MVVM + State 21 ViewModel State

  22. MVI 22 ViewModel State Action Result Intent

  23. Thank You 23 MVP: https://github.com/RivuChk/MovieSearchOMDBMVP MVVM: https://github.com/RivuChk/MovieSearchOMDBMVVM MVVM + State:

    https://github.com/RivuChk/MovieSearchOMDBMVVMState MVI: https://github.com/RivuChk/Android-MVI-Clean-Arch-Sample https://www.rivu.dev