Slide 1

Slide 1 text

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

Slide 2

Slide 2 text

Rivu Chakraborty Sr. Software Engineer - BYJU’S https://rivu.dev Tech Author, Tech Speaker, Android Dev, Kotlin Advocate 2

Slide 3

Slide 3 text

Arch Patterns in Android 3

Slide 4

Slide 4 text

Architecture What is an Architecture 4

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

Architecture Where does it come from? What Patterns / Principles 6

Slide 7

Slide 7 text

SOLID Principles 7

Slide 8

Slide 8 text

Every class should have a Single Responsibility Single-Responsibility 8

Slide 9

Slide 9 text

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

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

Clients should not be forced to depend upon interfaces that they do not use. Interface Segregation 11

Slide 12

Slide 12 text

A class that uses a dependency, shouldn’t create / know how to create that dependency Depencency Inversion (IoC) 12

Slide 13

Slide 13 text

Layers In an usual Android App 13

Slide 14

Slide 14 text

data presentation ui domain (?) cache remote

Slide 15

Slide 15 text

data presentation ui

Slide 16

Slide 16 text

data 16 Repository LocalDataStore RemoteDataStore AppService / ApiService DB

Slide 17

Slide 17 text

presentation & ui 17 MVP MVI MVVM MvRx mobius

Slide 18

Slide 18 text

Architecture Patterns 18

Slide 19

Slide 19 text

MVP 19 View Interface Contract Presenter Interface tight coupling

Slide 20

Slide 20 text

MVVM 20 ViewModel

Slide 21

Slide 21 text

MVVM + State 21 ViewModel State

Slide 22

Slide 22 text

MVI 22 ViewModel State Action Result Intent

Slide 23

Slide 23 text

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