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
9
votes
1 answer

Why state cannot be part of Presenter in MVP?

I read http://www.codeproject.com/KB/architecture/MVC_MVP_MVVM_design.aspx and it said: As powerful as they are, both MVC and MVP have their problems. One of them is persistence of the View’s state. For instance, if the Model, being a …
Tower
  • 98,741
  • 129
  • 357
  • 507
9
votes
2 answers

Why is unit testing harder in MVC than in MVP and MVVM

I've been doing some research on pros and cons of MVC/MPV/MVVM and one common theme is that MVC is harder to unit test than MVP and MVVM but I don't fully understand why. From my current understanding, in MVC, the view is dependent on the model and…
user3826764
  • 198
  • 1
  • 9
9
votes
6 answers

MVP or activities & places, for GWT 2.2

I've been looking into GWT and MVP recently and to be honest I'm very confused. My project will include around 40 different places or views all together. While reading multiple tutorials, some follow Model-View-Presenter and others use Activities…
Alex
  • 123
  • 1
  • 4
9
votes
3 answers

How do I handle HTTP errors like 401, 403, 503,500 using RxJava Observer instead of Event Bus

I'm using Retrofit, OK-HTTP and RxJava2 to handle network calls, I created below interceptor to handle the Network error response for each network calls, Is there a better way to Handle this? Is this the case for EventBus? I don't want to check this…
Sam
  • 6,215
  • 9
  • 71
  • 90
9
votes
2 answers

Drawback of MVP over MVVM design pattern in android

Hi I am reading this post https://news.realm.io/news/eric-maxwell-mvc-mvp-and-mvvm-on-android/ where they explained very well about mvc, mvp, mvvm. I undertood how mvp design pattern works. I don't find any drawback in MVP over MVVM. As they…
N Sharma
  • 33,489
  • 95
  • 256
  • 444
9
votes
5 answers

ASP.NET MVP vs ASP.NET MVC

My company is trying to make an informed decision about how to pursue future development. We seem to have narrowed down our future internal and external Applications to being web applications. But we are still a bit confused from that point. There…
Vaccano
  • 78,325
  • 149
  • 468
  • 850
9
votes
3 answers

Android MVP: which layer should store context variable

I find myself where i need to play a sound file when user clicks a button on a view. MediaPlayer requires a context to be created. What is the best way to put MediaPlayer initialization code? Should I pass a context into a presenter method and play…
Zhen Liu
  • 7,550
  • 14
  • 53
  • 96
9
votes
6 answers

Advantage of MVP in android

I am new in android development.I want to implement MVP in my project but I don't know What are the advantages of using MVP SO Please tell me what are the advantages of using MVP in android.
Vivek Pandey
  • 149
  • 2
  • 7
9
votes
1 answer

Android MVP with Dagger 2 - Activity with multiple fragments

I've been looking at the Google Android Architecture examples for MVP with Dagger…
prule
  • 2,536
  • 31
  • 32
9
votes
3 answers

RxJava with Presenter and retained fragment for configuration changes

I'm new to RxJava and using this together with MVP architecture. I've found a few examples on saving observables upon configuration changes using a retained fragment(still not sure if this is the best way to do it). The examples I've found though is…
jesobremonte
  • 3,198
  • 2
  • 22
  • 30
9
votes
5 answers

How should I pass data (e.g. which item was clicked) between Activities in MVP?

I have list of items shown with MVP pattern. View is an Activity (a.k.a. ItemsList). I want to show next Activity (also MVP'ed, a.k.a. ItemDetails) with details of item clicked in ItemsList. Model for ItemsList is fed with data from Repository. So…
Marian Paździoch
  • 8,813
  • 10
  • 58
  • 103
9
votes
0 answers

Implementing MVP in Android app

Every Android Developer faces with problem, that Activities or Fragments are to complicated, because most apps use only View-Model design. As do I, so I started looking for better solution. What caught my attention is MVP, which is old design, but…
user5762284
9
votes
7 answers

Android MVP explanation

I try to understand what the best way is to program a "clean" Android app. I found an interesting article about it where they use a kind of a 3 layer architecture. Now I read that android uses the MVP design pattern and try to understand this. The…
CodeNinja
  • 836
  • 1
  • 15
  • 38
9
votes
1 answer

ASP.NET MVP - Utilizing User Controls

I'm writing my first app with ASP.NET MVP (attempting Supervisory Controller) and Unit Testing (better late than never!), and I've run into a bit of a dilemma. I've written 3 User Controls, all tested and Interfaced up, Presenters in tow. Now I…
jstephenson
  • 147
  • 6
9
votes
6 answers

Any tutorials on the official GWT MVP framework?

Has anyone found/written any tutorials on the official GWT MVP framework that's found in the GWT 2.1 RC?
JP Richardson
  • 38,609
  • 36
  • 119
  • 151