The Wayback Machine - https://web.archive.org/web/20240914011225/https://www.geeksforgeeks.org/difference-between-mvc-and-mvp-architecture-pattern-in-android/
Open In App

Difference Between MVC and MVP Architecture Pattern in Android

Last Updated : 10 Nov, 2020
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

Developing an android application by applying a software architecture pattern is always preferred by the developers. An architecture pattern gives modularity to the project files and assures that all the codes get covered in Unit testing. It makes the task easy for developers to maintain the software and to expand the features of the application in the future. MVC (Model — View — Controller) and MVP (Model — View — Presenter) are the two most popular android architectures among developers.

The Model—View—Controller(MVC) Pattern

The MVC pattern suggests splitting the code into 3 components. While creating the class/file of the application, the developer must categorize it into one of the following three layers:

Model: This component stores the application data. It has no knowledge about the interface. The model is responsible for handling the domain logic(real-world business rules) and communication with the database and network layers.

View: It is the UI(User Interface) layer that holds components that are visible on the screen. Moreover, it provides the visualization of the data stored in the Model and offers interaction to the user.

Controller: This component establishes the relationship between the View and the Model. It contains the core application logic and gets informed of the user’s behavior and updates the Model as per the need.

The Model—View—Controller(MVC) Pattern

The Model—View—Presenter(MVP) Pattern

MVP pattern overcomes the challenges of MVC and provides an easy way to structure the project codes. The reason why MVP is widely accepted is that it provides modularity, testability, and a more clean and maintainable codebase. It is composed of the following three components:

Model: Layer for storing data. It is responsible for handling the domain logic(real-world business rules) and communication with the database and network layers.

View: UI(User Interface) layer. It provides the visualization of the data and keep a track of the user’s action in order to notify the Presenter.

Presenter: Fetch the data from the model and applies the UI logic to decide what to display. It manages the state of the View and takes actions according to the user’s input notification from the View.

Model—View—Presenter(MVP) Pattern

Key Differences Between MVC and MVP Design Pattern

MVC(Model View Controller)

MVP(Model View Presenter

One of the oldest software architecture Developed as the second iteration of software architecture which is advance from MVC.
UI(View) and data-access mechanism(Model) are tightly coupled. The View is loosely coupled to the Model.
Controller and View layer falls in the same activity/fragment Communication between View-Presenter and Presenter-Model happens via an interface.
User inputs are handled by Controller which instructs the model for further operations. User inputs are handled by View which instructs the presenter to call appropriate functions.
The many-to-one relationship exists between Controller and View as one Controller can select different View based upon required operations. The one-to-one relationship exists between Presenter and View as one Presenter class manages one View at a time.
The Controller is the overall in charge as it creates the appropriate View and interacts with the Model according to the user’s request. The View is the overall in charge in this schema as View call methods of Presenter which further directs Model.
Limited support to Unit Testing Unit Testing is highly supported.


Similar Reads

Difference Between MVC, MVP and MVVM Architecture Pattern in Android
Developing an android application by applying a software architecture pattern is always preferred by the developers. An architecture pattern gives modularity to the project files and assures that all the codes get covered in Unit testing. It makes the task easy for developers to maintain the software and to expand the features of the application in
6 min read
Difference Between MVP and MVVM Architecture Pattern in Android
Developing an android application by applying a software architecture pattern is always preferred by developers. An architecture pattern gives modularity to the project files and assures that all the codes get covered in Unit testing. It makes the task easy for developers to maintain the software and to expand the features of the application in the
4 min read
MVP (Model View Presenter) Architecture Pattern in Android with Example
In the initial stages of Android development, learners do write codes in such a manner that eventually creates a MainActivity class which contains all the implementation logic(real-world business logic) of the application. This approach of app development leads to Android activity gets closely coupled to both UI and the application data processing
12 min read
Difference Between MVC and MVVM Architecture Pattern in Android
Developing an android application by applying a software architecture pattern is always preferred by the developers. An architecture pattern gives modularity to the project files and assures that all the codes get covered in Unit testing. It makes the task easy for developers to maintain the software and to expand the features of the application in
5 min read
Android MVP Architecture Extension with Interactors and Repositories
Nature's truth is evolution, and new developments are led by natural selection. As a result, there are many diverse species with numerous similarities, and they all adapt best to their environment. The concept that one is superior to the other is only applicable under limited circumstances when one is more suited for survival. When the circumstance
5 min read
How to Build SIP Calculator Android App using MVP Architecture?
SIP, the Systematic Investment Plan. One of the methods to invest in Mutual Funds is weekly, monthly quarterly, or half-yearly. The SIP calculator is the tool to get an idea for investors about their investment returns. However, the returns of mutual funds vary on various factors. For example, the SIP calculator does not calculate the Absolute retu
10 min read
MVC (Model View Controller) Architecture Pattern in Android with Example
Developing an android application by applying a software architecture pattern is always preferred by the developers. An architecture pattern gives modularity to the project files and assures that all the codes get covered in Unit testing. It makes the task easy for developers to maintain the software and to expand the features of the application in
8 min read
Difference between Shared Nothing Architecture and Shared Disk Architecture
1. Shared Nothing Architecture : Shared nothing architecture is an architecture that is used in distributed computing in which each node is independent and different nodes are interconnected by a network. Every node is made of a processor, main memory, and disk. The main motive of this architecture is to remove the contention among nodes. Here the
3 min read
Difference between System Architecture and Software Architecture
1. System Architecture : System architecture is a conceptual model that describes the structure and behavior of multiple components and subsystems like multiple software applications, network devices, hardware, and even other machinery of a system. It is Architecture Description Language (ADL) which helps to describe the entire system architecture.
3 min read
Difference between Solution Architecture and Cloud Architecture
1. Solution Architecture :Solution Architecture, as name suggests, is basically process of designing one or more applications or services within organization or company. It is generally a part of solution development team that help to ensure that new system will fit existing enterprise environment and provide strategic direction to project.2. Cloud
3 min read
Difference between Information Architecture and Data Architecture
Information Architecture (IA) and Data Architecture (DA) are often mixed up, but they have different jobs in an organization. Information Architecture is about how information is organized and shown to users so they can easily get it. Data Architecture is about the technical side of data systems, making sure data is stored, handled, and used correc
5 min read
Difference between Enterprise Architecture and Business Architecture
Enterprise Architecture (EA) and Business Architecture (BA) are essential frameworks for organizing and managing an organization's structure and processes. However, they serve different purposes and focus on distinct aspects of an organization. Enterprise Architecture provides a comprehensive blueprint that integrates IT infrastructure, business pr
4 min read
MVVM (Model View ViewModel) Architecture Pattern in Android
Developers always prefer clean and structured code for projects. Organizing the codes according to a design pattern helps in the maintenance of the software. By having knowledge of all crucial logic parts of the android application, it is easier to add and remove app features. Further, design patterns also assure that all the codes get covered in U
7 min read
Difference between MVC and MVT design patterns
1. Model View Controller (MVC) : It is a software design pattern that is used to implement user interfaces and gives emphasis on separating data representation from the components which interact and process the data. It has 3 components and each component has a specific purpose: This Model is the central component of this architecture and manages t
2 min read
Difference between Spring MVC and Spring Boot
1. Spring MVC : Spring is widely used for creating scalable applications. For web applications Spring provides Spring MVC framework which is a widely used module of spring which is used to create scalable web applications. Spring MVC framework enables the separation of modules namely Model View, Controller, and seamlessly handles the application in
3 min read
Difference Between ApplicationContext and WebApplicationContext in Spring MVC
Spring MVC framework enables separation of modules namely Model, View, and Controller, and seamlessly handles the application integration. This enables the developer to create complex applications also using plain Java Classes. The model object can be passed between view and controller using maps. What is ApplicationContext?Spring IoC container is
3 min read
Difference between Android 1.1 and Android 4.0.1
1. Android 1.1 : Android 1.1 is the second version of Android which was introduced by Google after Android 1.0. It had all the features that were included in the previous version i.e. Android 1.0 and also some more features were added in this version. Some features were added in caller applications like hiding and showing of the numeric keyboard. T
4 min read
Difference between Android 1.1 and Android 2.3.4
1. Android 1.1 : Android 1.1 is the second version of Android which was introduced by Google after Android 1.0. It had all the features that were included in the previous version i.e. Android 1.0 and also some more features were added in this version. Some features were added in caller applications like hiding and showing of the numeric keyboard. T
3 min read
Difference between Android 1.0 and Android 1.1
1. Android 1.0 : Android 1.0 is the very first version of Android which was introduced by Google. It had some basic features including web browser support, camera support, Gmail counts, google maps, and youtube application. Although it does not have the official version name like further introduces versions but unofficially it is called Apple Pie.
2 min read
Difference between Android 1.0 and Android 7.1
1. Android 1.0 : Android 1.0 is the very first version of Android which was introduced by Google. It had some basic features including web browser support, camera support, Gmail accounts, Google maps and Youtube application. Although it does not have the official version name like further introduces versions but unofficially it is called Apple Pie.
3 min read
Difference between Android 1.0 and Android 2.3
1. Android 1.0 : Android 1.0 is the very first version of Android which was introduced by Google. It had some basic features including web browser support, camera support, Gmail counts, Google maps and Youtube application. Although it does not have the official version name like further introduces versions but unofficially it is called Apple Pie. T
2 min read
Difference between Android 1.0 and Android 2.2
1. Android 1.0 : Android 1.0 is the very first version of Android which was introduced by Google. It had some basic features including web browser support, camera support, Gmail counts, Google maps and Youtube application. Although it does not have the official version name like further introduces versions but unofficially it is called Apple Pie. T
2 min read
Difference between Android 1.0 and Android 1.6
1. Android 1.0 : Android 1.0 is the very first version of Android which was introduced by Google. It had some basic features including web browser support, camera support, Gmail counts, Google maps, and a Youtube application. Although it does not have the official version name like further introduces versions unofficially it is called Apple Pie. Th
4 min read
Difference between Android 1.0 and Android 2.1
1. Android 1.0 : Android 1.0 is the very first version of Android which was introduced by Google. It had some basic features including web browser support, camera support, Gmail counts, Google maps and Youtube application. Although it does not have the official version name like further introduces versions but unofficially it is called Apple Pie. T
2 min read
Difference between Android 1.0 and Android 2.0.1
1. Android 1.0 : Android 1.0 is the very first version of Android which was introduced by Google. It had some basic features including web browser support, camera support, Gmail counts, Google maps and Youtube application. Although it does not have the official version name like further introduces versions but unofficially it is called Apple Pie. T
2 min read
Difference between Android 1.0 and Android 2.0
1. Android 1.0 : Android 1.0 is the very first version of Android which was introduced by Google. It had some basic features including web browser support, camera support, Gmail counts, Google maps and Youtube application. Although it does not have the official version name like further introduces versions but unofficially it is called Apple Pie. T
2 min read
Difference between Android 1.0 and Android 1.5
1. Android 1.0 : Android 1.0 is the very first version of Android which was introduced by Google. It had some basic features including web browser support, camera support, Gmail accounts, Google maps and Youtube application. Although it does not have the official version name like further introduces versions but unofficially it is called Apple Pie.
2 min read
Difference between Android 1.0 and Android 2.3.3
1. Android 1.0 : Android 1.0 is the very first version of Android which was introduced by Google. It had some basic features including web browser support, camera support, Gmail counts, Google maps and Youtube application. Although it does not have the official version name like further introduces versions but unofficially it is called Apple Pie. T
2 min read
Difference between Android 1.0 and Android 4.2.1
1. Android 1.0 : Android 1.0 is the very first version of Android which was introduced by Google. It had some basic features including web browser support, camera support, Gmail accounts, Google maps and Youtube application. Although it does not have the official version name like further introduces versions but unofficially it is called Apple Pie.
2 min read
Difference between Android 1.0 and Android 2.3.7
1. Android 1.0 : Android 1.0 is the very first version of Android which was introduced by Google. It had some basic features including web browser support, camera support, Gmail counts, Google maps and Youtube application. Although it does not have the official version name like further introduces versions but unofficially it is called Apple Pie. T
2 min read