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

Robolectric 3.8 with MVP and mocking setupActivity()

I use Android MVP architecture and I want to test my View. I have the following code in my project: @RunWith(RobolectricTestRunner.class) @Config(constants = BuildConfig.class, sdk = 21) public class MainActivityTest { @Test public void…
Michał Dobi Dobrzański
  • 1,449
  • 1
  • 20
  • 19
0
votes
1 answer

Error Code 415 with retrofit

I have created following API class to query the web service @POST("/v1/User/forgot-password") @FormUrlEncoded fun forgotPass(@Field("email") email: String): Call and called it as val call =…
Ahmed S. Durrani
  • 1,535
  • 2
  • 17
  • 41
0
votes
1 answer

Updating view from recyclerview adapter using MVP pattern

I have a fragment called "OverviewFragment" and i have a presenter and Contract for it. I am creating a recyclerview adapter from "Overview fragment". I have certain doubts regarding how to populate content inside the recyclerview. I have read that…
emilpmp
  • 1,716
  • 17
  • 32
0
votes
1 answer

MVP Implimentation - Smart Client Software Facotry (SCSF) vs. The MVC# Framework

I came across these two tools to help in implementing the MVP pattern in Microsoft .NET: Architecting Applications for the Enterprise. The book just has a few paragraphs about them, so I'd like to explore them more in-depth. I currently am only…
Matt
  • 14,353
  • 5
  • 53
  • 65
0
votes
0 answers

How to restore the application state when using Dagger2 + MVP

EDITED 2 I have an Activity with multiple fragments. The Activity manages a form with several steps, each step being a Fragment. My implementation follows the MVP design pattern and I'm using Dagger2 to inject the components (Presenters, Models,…
Eselfar
  • 3,759
  • 3
  • 23
  • 43
0
votes
2 answers

Activity or Fragment as View on MVP

I'm trying to know which is the better implementation of the view on MVP. For example in small Apps, It's better to use one or two activity's and use as a View the Fragments? or It's better use one Activity for all screens as View without any…
0
votes
2 answers

MVP with Moq - loading a mocked view

I've read a lot about mocking/stubbing/faking - and still hit my mental roadblocks. I'm trying to adapt MVP (Model View Presenter) with a "fun" weight loss tracking system I'm building for my own Fatty McFatter-self. I'm trying to TDD & 'by the…
ajwaka
  • 608
  • 1
  • 7
  • 12
0
votes
1 answer

Allowing View To Use Presenter's Model Property For Databinding in MVP

I have a Winform Model View Presenter (MVP) application which has a Presenter object passed in at instantiation time via an interface. The Presenter (ProductPresenter) has a model (ProductModel) property. I am allowing the View (ProductView) to…
Robertcode
  • 911
  • 1
  • 13
  • 26
0
votes
1 answer

Android retrofit call bad behavior

Good day, so my problem as follows. When I initialize the retrofit call it has following flow. 1.In the Presenterclass, it goes to getData method. 2.Then it goes to Interactorclass and creates a instance of itself. 3.Then it starts to fetch data…
0
votes
1 answer

How to mutually link fragments with presenters using dagger-android?

I would like to have a fragment module which provides a view (fragment) and the presenter. View depends on the presenter, presenter depends on the view, and dagger takes care of those dependencies. I've seen this method to work for activities and…
mpontus
  • 2,143
  • 2
  • 19
  • 21
0
votes
1 answer

Cannot understand why interfaces provide abstraction in Java

I'm trying to develop an Android app following MVP pattern so I can separate the views from the logic of the application. So let's put an example in order to illustrate my doubts. public interface IView { public void showToast(String…
Aldridge1991
  • 1,326
  • 6
  • 24
  • 51
0
votes
1 answer

JSON API changing value read in

I'm reading in an Object from JSON API. The object is as follows... "current_form_details": { "key": 9, "form_name": "Pre Surgery Functional Assessment - Knee", "date_available": 1521155679 This is straight from my Logcat... Now what I am doing is…
Kyle
  • 695
  • 6
  • 24
0
votes
2 answers

Observable from merged Observable.just and Subject emits nothing

i have a chain of calls from a presenter to repository which returns an observable. This is the code: Presenter: private fun getCategories() = compositeDisposable.add( categoriesUseCase.getCategories() …
colymore
  • 11,776
  • 13
  • 48
  • 90
0
votes
1 answer

Additional layer of abstraction for asynchronous operations

My question will be more design or architecture related. Just need some advice from more experienced engineers. I'm learning RxJava/RxAndroid now and would like to replace my asynchronous logic in an app based on lessons learned. I have an app…
0
votes
1 answer

Post Data To Server Using MVP Android

I am learning MVP design for the Android , I am new to it so need your valuable time . I went to the basics of the MVP how it work , Now i got stuck so need your help , I have to post the data to the server , when i hard code the value in presenter…
Barnali Bhattacharjee
  • 497
  • 2
  • 10
  • 24