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

How to do additional logic onSuccess case in RxJava

I am developing an Android app. RxJava is used. It stores user data in the local database with expire time. First, it gets user data from the local database. And check the expire time, if the data is old data, then it gets user data from remote…
yoonhok
  • 2,575
  • 2
  • 30
  • 58
0
votes
1 answer

Understanding Model & ViewModel in WebView/WinForm in MVP/MVC

I am trying to understand and implement different UI patterns in .NET to see the pros and cons and where they suite best. I understand the main concept but I was creating an app and a question appeared. Say we have a class Customer, which represents…
Rafa Gomez
  • 690
  • 8
  • 24
0
votes
2 answers

warp MVP presenter inside viewmodel in android?

one of mvp presenter pattern disadvantages is handling activity state or orientation change , while viewmodel survive orientation changes , so can i wrap presenter inside a viewmodel and still using MVP ?
0
votes
1 answer

restoring state in a presenter with MVP

https://medium.com/@cervonefrancesco/model-view-presenter-android-guidelines-94970b430ddf says to restore state in the model instead of the presenter. What if I have a very simple "model", say a binary toggle that updates a textview to be on or…
user3148156
  • 168
  • 1
  • 1
  • 13
0
votes
1 answer

Multiple Fragments(Views) and Presenters with a single activity (MVP)

I'm developing an Android application using the MVP pattern which uses Firebase Services and Firebase Authentication. In the authentication module, I have three fragments(views) - a) Intro Screen fragment, b) Sign In Fragment and c) Sign Up…
0
votes
1 answer

How to fill DataGridView in a MVP project?

Backstory: I am creating (trying) a inventory management application for android. For data replication testing I made simple WinForms application. Purpose of this app is simply to load data from SQL Server DB (DB table name is T_STOCK). For data…
0
votes
1 answer

List all the images in view (MVP) - PHP

I have worked on a small gallery app in the MVP framework (name isn't important, because it isn't famous) and I don't know, how to display all the images from /gal/ folder. I have something like this in my presenter -…
Droid
  • 79
  • 2
  • 2
  • 7
0
votes
1 answer

Better approach for updating View components from Presenter, using MVP

I recently started working with WinForms via MVP (PassiveView) pattern and stuck on "How to make View update itself while presenter does long (for like 20 seconds) async operations" So I have a form, an IView implementation with UI items: a Button…
Kirill F.
  • 159
  • 1
  • 6
0
votes
2 answers

Is possible to finish unit testing when a method is called?

Here is my test method where It should be success if showLoading() and loadDataSuccess(response) was called: @RunWith(PowerMockRunner.class) public class PresenterTest { @Mock private ProfileContract.View view; …
azsoftco
  • 812
  • 1
  • 8
  • 20
0
votes
1 answer

how to emit error then emit the cached data using RxJava?

I am using RxJava in a MVP solution and I want to achieve this scenario: try to get the server data and if its successful populate the view using server data if its unsuccessful for any reason (no internet - server unreachable - server internal…
Amir Ziarati
  • 14,248
  • 11
  • 47
  • 52
0
votes
2 answers

Using several interactors in a project

I'm stack on applying MVP pattern to my project. I have 2 different activities: one obtains data from local database and the other makes mathematical calculations. In MVP pattern it is possible to use interactors and I'd like to use them in my…
S.Drumble1
  • 83
  • 1
  • 10
0
votes
1 answer

Android: MVP how does the model communicate back with the presenter?

My question is: When I'm doing some business in the model, How can send data back to the presenter depending on a callback method such as onSuccess? I'm simply try to implement a Facebook login while using the MVP design pattern. First I was…
0
votes
1 answer

Injecting presenters with MVP/Dagger 2

I've been learning about DI and Dagger 2 recently, and I feel like I'm ending up with more boilerplate than what I started with. My setup includes AppComponent -- provides Application, Resources and other networking-related stuff. @Singleton…
amitavk
  • 1,196
  • 1
  • 12
  • 15
0
votes
2 answers

Android - NPE when using FragmentPagerAdapter and rotating device

I am trying to implement an MVP architecture by following Google's sample todo app The problem I have is that I am getting a NPE when starting my presenter in the onResume() of the fragments. This happens when I change the orientation of the…
0
votes
0 answers

About managing Views when using Dependency Injection (MVP pattern)?

Without using DI (Dependency Injection), I can create the View instance myself and I can determine its lifetime myself (create new one each time before showing or just re-show it because it is just hidden). The problem here involves both DI and the…
Hopeless
  • 4,397
  • 5
  • 37
  • 64