Mobile Dev - Chapter 4
Mobile Dev - Chapter 4
Chapter 4
Mobile Application
Architecture
Hoang Le Hai Thanh
High Performance Computing Laboratory, HCMUT, VNU-HCM
C03043 - MOBILE APP DEVELOPMENT
Content
The Model represents a set of classes that describes the business logic and
data. It also defines business rules for data means how the data can be
changed and manipulated.
The View represents the UI components. It is only responsible for
displaying the data that is received from the presenter as the result. This
also transforms the model(s) into UI.
The Presenter is responsible for handling all UI events on behalf of the
view. This receives input from users via the View, then process the user's
data with the help of the Model and passes the results back to the View.
Model
View
ViewModel
MVVM stands for Model-View-View Model. This pattern supports
two-way data binding between view and View model.
Model: This holds the data of the application. It cannot directly talk to the
View. Generally, it’s recommended to expose the data to the ViewModel
through Observables.
View: It represents the UI of the application devoid of any Application
Logic. It observes the ViewModel.
ViewModel: It acts as a link between the Model and the View. It’s
responsible for transforming the data from the Model. It provides data
streams to the View. It also uses hooks or callbacks to update the View. It’ll
ask for the data from the Model.
VIPER (iOS)
VIPER is a backronym for View, Interactor, Presenter, Entity, and
Router.
https://medium.com/androiddevelopers/google-i-o-2018-app-architecture-and-testing-f546e37fc7eb
Model
View
Intent
MVI stands for Model-View-Intent. MVI imagines the user as a
function, and models a unidirectional data flow based on that.
Model- Other than representing the data and the business logic of the
application model maintains a state which can be changed through the
actions of the user.
View- Represents the UI layer of the application which consists of
Activities and Fragments. It accepts different model states and displays
them as a UI.
Intent- do not confuse it with the Android Intent, it’s the intention to
perform an action either by the user or the app itself.
React Redux
Store
This is simply a state container that holds on to your app state. It holds an
immutable reference representing the entire state of your application and
can only be updated by dispatching an Action to it.
Actions
Actions contain information to be sent to the store. They represent how
we want our state to be changed.
Reducers
Since neither Actions nor the Store update state themselves, we need a
component dedicated to doing this. That’s where Reducers come in. They
simply take an Action and State and emit a new State.
THE BIG PICTURE
THANK YOU
Hoang Le Hai Thanh
High Performance Computing Laboratory
thanhhoang@hcmut.edu.vn