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
11
votes
2 answers

MVP and presenter granularity

We've been using the MVP pattern and Winforms with a fair amount of success. However, a question always pops-up about MVP: What is a good granularity for presenters? What I mean by that is: With Winforms, a fine-granularity usually works quite well…
Bryan Menard
  • 13,234
  • 4
  • 31
  • 47
10
votes
2 answers

Does the Presenter Perform GUI Logic in the MVP Pattern?

We are working with the MVP pattern, and I was wondering how to deal with GUI actions. For instance, when the user wants to delete a row from a grid, the user presses the delete button. At this point you can do two things: 1) Call…
Martijn
  • 24,441
  • 60
  • 174
  • 261
10
votes
1 answer

Live Data in MVP architectural pattern

I have an application with MVP architectural pattern. Now, I am trying to implement Livedata in my application. I searched a lot , but I can not found any tutorial or example for this. All tutorial says live data is for MVVM pattern. Applying…
Ranjith KP
  • 858
  • 6
  • 18
10
votes
3 answers

Best practice for package structure in an MVP project

I have an Android Studio project that is using an MVP architecture. What is the advised packages structure for a project this style we can do: app: screen_name activityA presenterA interfaceA or: activities activityA …
presenchi
  • 113
  • 1
  • 4
10
votes
2 answers

android MVP - can I have multiple presenters for custom views and fragments

So I have an a presenter that is already tied to an activity. The book says that one presenter should be tied to one view. But now I am adding a few fragments and lots of custom views. I am considering a fragment to be a view as well. The custom…
j2emanue
  • 60,549
  • 65
  • 286
  • 456
10
votes
4 answers

Dagger 2 can not resolve symbol 'DaggerAppComponent'

I'm trying to create a simple app with retrofit 2, dagger 2 and MVP, but I struggle with dependencies, actualy, this is the error I get after i try to rebuild the project Error:Execution failed for task…
joe
  • 1,341
  • 4
  • 21
  • 32
10
votes
1 answer

Implementing GoogleApiClient on Android mvp using dagger?

there is a couple of question I have, first, as I read some of the articles, I should implement LocationListener, ConnectionCallback,OnConnectionFailedListener interfaces in the activity, is it right to seperate the implementation of these classes…
10
votes
2 answers

communicate between presenters in MVP android application

I am using MVP pattern to build a small test android app. I have two fragments Fragment B (I am using for sliding drawer) and Fragment A (main fragment). Both fragments have their own presenters. when I click on sliding draw it should send message…
user1154390
  • 2,331
  • 3
  • 25
  • 32
10
votes
1 answer

Android MVP architecture standard for loading UI with Model class having android resource

I am following MVP architecture in my application. My HomeActivity contains a Sliding Panel with list icon having selector that is upon selecting the Sliding Panel item the icon state is changed and i am not using any list selector. I am keeping a…
Sunny
  • 1,066
  • 1
  • 13
  • 32
10
votes
5 answers

Reusing Monotouch code in Monodroid app

I'm currently implementing a Monotouch application that will eventually be ported to Monodroid. The application is just a client to an OData Web service. Nothing too fancy or performance critical. The challenge is to reuse as much code as possible.…
Adrian Grigore
  • 33,034
  • 36
  • 130
  • 210
10
votes
2 answers

Android MVP with RxAndroid + Retrofit

Recently I started reading a lot about MVP and I want to get into practicing my projects with it. However I am not able to correctly understand where should Rx + Retrofit code go? I think it should be in Model Layer via Interactors but still can…
Rinav
  • 2,527
  • 8
  • 33
  • 55
10
votes
5 answers

example Model-View-Presenter app in nodejs

I am exploring different MV* patterns and noticed that MVP is used very heavily in .Net applications but almost no where else. The only other big framework that seems to incorporate it is GWT but only in some parts. Why is MVP such a microsoft…
mkoryak
  • 57,086
  • 61
  • 201
  • 257
9
votes
4 answers

What is the legend of the arrows in these diagrams (MVC - MVP - MVVM)?

I try to understand the main differences between MVC / MVP and MVVM patterns. I found these 3 diagrams but I'm not sure to understand them. Coul you help me and explain me what is the legend of the dashed line and continuous line. MVC from Wikipedia…
Bastien Vandamme
  • 17,659
  • 30
  • 118
  • 200
9
votes
2 answers

MVP pattern, how many views to a presenter?

We are trying to get the Model-View-Presenter pattern used on (virtually) all new dev work that we undertake. I'm a strong believer in having a framework to help people meet a design requirement, we have a few in-house frameworks for various…
Aaron Powell
  • 24,927
  • 18
  • 98
  • 150
9
votes
1 answer

Testing Presenters in MVP GWT application

I have a simple application and want to make it testable. I m new in this area. Here is a simple Presenter, taking in mind this code ,could you advice or give me some example how to test it. public class SomePresenter extends…
adgfs
  • 423
  • 6
  • 17