solution to a commonly occurring problem in software architecture within a given context. It’s the only way to maintain a project clean, expansible and testable. Model–view–controller (MVC) is a software architectural pattern mostly (but not exclusively) for implementing user interfaces oncomputers. It divides a given software application into three interconnected parts, so as to separate internal representations of information from the ways that information is presented to or accepted from the user. - Wikipedia
actions to the presenter to act upon. A Passive View handles this by reducing the behavior of the UI components to the absolute minimum by using a controller that not just handles responses to user events, but also does all the updating of the view. This allows testing to be focused on the controller with little risk of problems in the view. – Martin Fowler The Passive View
only given information by the presenter but in MVC both the view and model can interact with themselves The MVP also introduces the Passive View Pattern by Martin Flowler.
layer and model layer are bound by a contract Model and View layer never interact with each other View layer is passive Android APIs resides in the View Layer Model & Presenter are pure Java code Each layer have clearly defined functionalities by the use of a contract, this makes it easier to test, Find and fix bugs
you have a user detail screen, you create a package called userdetail Every screen is in its own package containing the Activity/Fragment (View), Presenter & Contract The advantage of this is that it is very easy to modify or add new features with minimal collision
in data repository format Model layer is not bound to any contract hence making it accessible to all parts of the app With all parts of the app placed under specific boundaries, modifications or new updates pose minimal impact on existing pieces
app is completely decoupled. Our models and presenters are pure Java, they can be easily tested using JUnit High increase in testing speed since Junit are faster than Espressor and other Android Tests