Questions tagged [mvp]

Model View Presenter (MVP) is a derivative of the model-view-controller software pattern, used mostly for building user interfaces.

Model-view-presenter (MVP) is a derivative of the model-view-controller software pattern, used mostly for building user interfaces.

In MVP, the presenter assumes the functionality of the "middle-man" (played by the application controller in MVC). Additionally, the view is responsible for handling the UI events (like mouse down, key down, etc.), which used to be the controller's job. Eventually, the model becomes strictly a domain model.

Source: Wikipedia article Model–view–presenter

1962 questions
22
votes
2 answers

In MVP is onClick responsibility of View or Presenter?

In the MVP pattern who is responsible to handle clicks on the UI? E.g. the non-MVP approach would be something like: counterButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { totalClicks++; …
Jim
  • 18,826
  • 34
  • 135
  • 254
21
votes
4 answers

Confusion around the whole GWT MVP vs Activity and Places

After reading a while and watching Google IO videos, I am still confused on how MVP relates to Activity and Places. I found a thread posted a while back --> GWT 2.2 MVP vs. GWT 2.1 Activities-Places "MVP architecture. MVP is the concept, and one of…
Nitish Upreti
  • 6,312
  • 9
  • 50
  • 92
20
votes
3 answers

Always use MVVM in a WPF app, or are alternative patterns still practical/useful?

On page 374 in the book Microsoft .NET Architecting Applications for the Enterprise, there is a chart regarding the evolution of patterns for the presentation layer and their impact on platforms (figure 7-14). In addition to showing the evolution…
Matt
  • 14,353
  • 5
  • 53
  • 65
20
votes
2 answers

C# WinForms Model-View-Presenter (Passive View)

I'm developing a WinForms application in C#. I have limited experience in GUI programming, and I am having to learn a great deal on the fly. That being said, here's what I am building. See the general GUI look at the following link: GUI…
Daniel McClelland
  • 377
  • 1
  • 4
  • 13
20
votes
1 answer

Shared Element Transitions Between Views (not Activities or Fragments)

Let's say I'm using a view-based approach to develop an Android application like for example described in the following article: http://corner.squareup.com/2014/10/advocating-against-android-fragments.html So now I have two full screen views. One is…
Eugen
  • 2,770
  • 4
  • 26
  • 31
20
votes
5 answers

Composition vs Inheritance in MVP

I'm using MVP pattern to develop a large scale application. While working in the development I have come up with the question whether if composition or inheritance should be used. For example: Let's assume that I have a form called Foo with fields A…
Sednus
  • 2,095
  • 1
  • 18
  • 35
19
votes
2 answers

MVP Framework for winforms

i'm working in a new project and i want to implement MVP pattern. There is a framework for winforms that use this pattern? I checked CAB but my project isn't complex to implement it, i search for something more simple to implement and use. Thanks!
fcartu
  • 355
  • 1
  • 9
  • 20
19
votes
5 answers

Where to put BroadcastReceiver in Android MVP?

I have a BroadcastReceiver implementation that receives network connection events. its declared in the AndroidManifest.xml and is called by Android automatically when network events occur. BroadcastReceiver: public class ConnectivityChangeReceiver…
Rory
  • 4,030
  • 4
  • 17
  • 21
18
votes
2 answers

What is the difference between controller in MVC pattern and presenter in MVP pattern?

What is the difference between controller in MVC pattern and presenter in MVP pattern? Can you provide links for understanding the Merits and usage scenario for both of them?
Sulla
  • 7,631
  • 9
  • 45
  • 71
18
votes
2 answers

Uncle Bob's clean architecture approach - what is recommended package structure?

I'd like to know if I'm using Clean Architecture the right way. I am trying to lay it like this diagram: I've read that the package structure should be arranged by use case but I'm having difficulty following how that would be done. Let's take a…
j2emanue
  • 60,549
  • 65
  • 286
  • 456
18
votes
2 answers

WPF: MVP vs MVVM

What is the difference between MVP VS MVVM? Why we are using MVP even though we have three layers: business, data access and presentation? Is there any specific reason to divide the Presentation layer into MVP?
Rajesh Kumar G
  • 1,424
  • 5
  • 18
  • 30
18
votes
2 answers

Android MVP, where check internet connection

I'm implementing MVP pattern on an Andorid App and I have a doubt about where is the best place for checking the internet connection. I usually check if there is internet connection before doing any network call. So, where should I check it in the…
Jose M Lechon
  • 5,766
  • 6
  • 44
  • 60
18
votes
1 answer

What's the difference between Model-View-Presenter and Model-View-Adapter?

I'm trying to understand whether there's a difference between the Model-View-Presenter and Model-View-Adapter patterns, and--if so--what that difference is. I haven't found any online resources that compare/contrast them, so I'm not even sure…
Matt Tsōnto
  • 1,518
  • 1
  • 15
  • 30
17
votes
5 answers

Is ASP.net Model View Presenter worth the time?

I'm reading about ASP.net MVP pattern over this weekend and it seem like even the most simple task take too much effort if do it in MVP pattern the pay off seem to be at larger project but i think to myself if i'm going to follow MVP. Why not just…
Jack
  • 9,843
  • 23
  • 78
  • 111
17
votes
4 answers

MVP and multiple User Controls

I’m trying to use the MVP pattern and I’m running into a design problem. I’m developing an application that will have several UserControls. The UserControls themselves have nothing to do with one another and only represent a subset of the actual…
SwDevMan81
  • 48,814
  • 22
  • 151
  • 184