Questions tagged [mvp]

The Model-View-Presenter (MVP) architectural pattern that enforces the separation of concerns in presentation logic. This pattern is a derivation of the Model–View–Controller (MVC) architectural pattern.

Similar to the Model View Controller (MVC), the MVP model has a 'middle man' (the Presenter) that separates the domain model from the view by handling all presentation logic. In this pattern, the view and the model are unaware of each other and work only through the presenter, which contains the presentation logic.

Related architectural patterns:

  • the classic Model View Controller
  • Model View ViewModel
115 questions
50
votes
2 answers

What are the improvements of MVP over MVC?

I have read for three days about the Model-View-Controller (MVC) and Model-View-Presenter (MVP) patterns. And there is one question that bothers me very much. Why did software designers invent MVP, when there already was an MVC? What problems did…
Victor
  • 611
  • 5
  • 7
35
votes
4 answers

Clean Architecture - Too many Use Case Classes

I'm going into Clean Architecture and lift my Android level from MVC to MVP, introducing DI with Dagger 2, Reactivity with RxJava 2, and of course Java 8. In MVP clean architecture there is a layer between the entities (in datastores) and the…
35
votes
3 answers

Is Model-View-Presenter (MVP) scheme useful for Android?

How to separate View and Presenter in Android, while the reactions on the user actions (Presenter part of MVP) are set into the same activities that shows GUI elements (View part of MVP). "In model view presenter just as Martin Fowler or Michael…
Gangnus
  • 2,805
  • 4
  • 21
  • 31
14
votes
1 answer

What is the difference between MVP and clean architecture

The question is self explanatory, just to add my thoughts : As far as I have read, The presentation layer in Clean arch has the same responsibility as in MV in MVP. How one decides to choose one pattern instead of the other?
Mehrdad Shokri
  • 251
  • 1
  • 2
  • 6
14
votes
4 answers

Proper Model-View-_____ design

I've been reading up about Model View Controller, Model View Presenter, Model View ViewModel, and so on, and generally, the underlying concept seems pretty simple to understand: keep the pretty visuals and sciencey guts as separate and ignorant of…
10
votes
2 answers

MVP (Supervising Controller) Does the view update the model?

I've been reading about MVP, specifically Supervising Controller. One thing I'm having difficulty wrapping my head around is how the View interacts with the Model. It was my understanding that the Presenter should update the Model and that the View…
Eric
  • 361
  • 1
  • 3
  • 9
9
votes
1 answer

Patterns are not building blocks – so I shouldn't build an app on MVC/MVP patterns?

I've read this page about design patterns, and how you should treat them when writing your code. From my understanding, as the title in the link states: Patterns are not building blocks. If I understand correctly, this means not to use a design…
user287600
9
votes
1 answer

In MVP pattern should the View instantiate a Model object based on UI contents, or just pass these contents as parameters to the Presenter?

I'm using MVP pattern in an android app that I'm developing. I have basically 4 elements: The AddUserView where a new user can be added: The AddUserPresenter The UserInfo (the pojo) The UserInfoManager ( businness logic and storage manager) My…
Rômulo.Edu
  • 269
  • 2
  • 9
9
votes
1 answer

Showing a View from another View in MVP

This question is regarding MVP triads. Lets say I have two triads and first one has View1, Mode1 and Presenter1. Second triad has View2, Model2 and Presenter2. Now what I trying to do is, I just want to display the View2 when I click a button in…
CAD
  • 345
  • 2
  • 5
  • 16
8
votes
1 answer

How can one presenter be used for multiple views in MVP

I am using MVP for creating an android application, which takes data from server and sets to activity. I am forced to create one presenter for each view. Each view is unique because each view has different textviews/labels. The presenter will read…
user4057066
  • 223
  • 2
  • 5
8
votes
2 answers

c++ Model View Presenter: Where to construct presenter?

I'm using the Model View Presenter (MVP) pattern as described in The Humble Dialog Box paper (pdf) with an MFC project. I'm sure the issue is the same with most GUI toolkits. The thing that's bothering me is the concrete view (i.e., the dialog…
User
  • 1,541
  • 2
  • 16
  • 30
7
votes
1 answer

How many presenters should I use in proper MVP?

I have an Android app which I am refactoring to use MVP. I have an Activity that has two Fragments. Scenario 1 (one presenter): The presenter "knows" each view. So, if one view receives input a presenter method is called and it could call a method…
Willi Mentzel
  • 359
  • 3
  • 12
7
votes
3 answers

PHP MVC/PAC - Logged In/Admin checks placement

I have set-up a MVC/PAC-like structure for a web application (unsure if it fits any of these design patterns fully). In short it is: Routing in index.php, which selects the controller and method using the URL…
kgongonowdoe
  • 541
  • 4
  • 7
7
votes
1 answer

Who communicates with the database in MVC/MVP?

I am building a small application and want to save my business objects to a database. I have my business objects and a model that acts as a container for my business objects and provides methods for creating and deleting them. Updating the business…
Luca Fülbier
  • 543
  • 6
  • 12
7
votes
2 answers

In MVP, should presenters instantiate and control other presenters?

I've implemented an application using MVP with GWT, which is working out very nicely for views that have a single purpose. Now, it has evolved into views that are achieving multiple purposes in a single window. So now I have a view of views with…
hulkmeister
  • 797
  • 1
  • 8
  • 18
1
2 3 4 5 6 7 8