Jul.11
Interview: Android – Architecture
Question: What is MVC?
MVC (Model–View–Controller) is a software design pattern commonly used for developing user interfaces which divides the related program logic into three interconnected elements.
Model represents dynamic data structure, logic and rules, independent of the user interface.
View is any representation of information such as a chart, diagram or table.
Controller accepts input and converts it to commands for the model or view.
Question: What is MVP?
MVP (Model–View–Presenter) is a derivation of the MVC (Model–View–Controller) architectural pattern, and is used mostly for building user interfaces.
Model is an interface defining the data to be displayed or otherwise acted upon in the user interface.
View is a passive interface that displays data (the model) and routes user commands (events) to the presenter to act upon that data.
Presenter acts upon the model and the view. It retrieves data from repositories (the model), and formats it for display in the view.
Question: What is MVVM?
MVVM (Model-View-ViewModel) is a software design pattern which facilitates a separation of development of the graphical user interface from development of the business logic or back-end logic (the data model). The viewmodel is a value converter, meaning the viewmodel is responsible for exposing (converting) the data objects from the model in such a way that objects are easily manageable or presentable.
Model refers either to a domain model, which represents real state content (object-oriented approach), or to the data access layer, which represents content (data-centric approach).
View is a passive interface that displays data (the model) and routes user commands (events) to the viewmodel to act upon that data.
ViewModel converts model information into values that can be displayed on a view. MVVM uses binder, which automates communication and synchronization between the view and its bound properties in the viewmodel.
Question: What is MVI (Unidirectional Data Flow)?
MVI (Model-View-Intent) is a software design pattern which follow Unidirectional and Circular Data Flow. Any user interaction is processed by business logic which brings change in the state. Then this new state is rendered on view and presented to the user.
Model represents dynamic data structure, logic and rules, independent of the user interface. Model also holds state.
View is any representation of information such as a chart, diagram or table. Views can contain one or more intents.
Intent represents an intention or command to perform an action by the user. It does not represent “android.content.Intent”.