8. Everyday problems
Facing Android developers
App components lifecycle is not under control
Data stored in components is being lost
OS may kill your app at random
time
UI changes
8
11. Meet MVC
Model-View-Controller
Model: the data layer, manages the business logic and handling network
or database API.
View: the UI layer , a visualisation of the data from the Model.
Controller: the logic layer, gets notified of the user’s behavior and
updates the Model as needed.
11
13. How Should
MVC Be applied in Android
Views
Model and Controller
Activities, Fragments
Android free classes
13
14. perks and cons
Separation of concerns, testability and SRP
Complex dependencies, Lifecycle and UI changes
14
15. Moving to MVP
Model-View-Presenter
Let’s reduce the dependencies
Make a presentation layer for data retrieved from the
model
Sign a contact between the view and the presenter
15
19. Land on MVVM
Model-View-Presenter
View: informs the ViewModel about the user’s actions.
View model: exposes streams of data relevant to the View.
Data Model: abstracts the data source.
19
20. Land on MVVM
Model-View-Presenter
If the MVP pattern meant that the Presenter was telling the View directly
what to display, in MVVM, ViewModel exposes streams of events to
which the Views can bind to.
20