Questions tagged [mvp]

The Model-View-Presenter (MVP) architectural pattern that enforces the separation of concerns in presentation logic. This pattern is a derivation of the Model–View–Controller (MVC) architectural pattern.

Filter by
Sorted by
Tagged with
1 vote
2 answers
76 views

Should selected person be part of my application layer? (MVP pattern)

Consider the following GUI screen: When user selects a person from PersonListView, EditPersonView should show person's first name and last name and allow the user edit. So, I end up with the ...
user avatar
  • 705
-3 votes
1 answer
175 views

Proper way of implementing MVP passive in C# .net

In "MVP Passive" where a view doesn't know about it's presenter the view just raises events observed by the presenter, the presenter knows the view and its controls how should view and ...
user avatar
-1 votes
2 answers
71 views

How to construct a model state dependent context menu in a MVP GUI application

Lets say I have a GUI application which tries to adhere to Model-View-Presenter (MVP) as best as possible. In this application I have a list box with items. One should be able to interact with these ...
user avatar
  • 27
1 vote
0 answers
98 views

Rest API backend and React frontend is MVP?

I'm doing a website that has a React frontend that calls some RESTful API and I would like to know if this is an MVP pattern. I think that the React application implements the View and the Presenter, ...
user avatar
-3 votes
1 answer
199 views

What is advantage of parameter-less methods?

MVP best practices recommend using parameter-less methods when view and presenter communicate. Even if using events, it is recommended not to use event parameters. It is recommended to change class ...
user avatar
  • 15
1 vote
1 answer
264 views

Adding item (or incrementing count) to ListView, with the MVP pattern in WinForms

Description A WinForms application with the following as part of a form: When the "Add" button is clicked, a new entry is added to the ListView, with data from the TextBoxes and ...
user avatar
  • 236
-6 votes
1 answer
72 views

Outsourcing The MVP development

our company wants to outsource the development of MVP. Since it is my first project as a product manager, I am expecting story map ERD Technical specifications i.e. language, database, DevOps & ...
user avatar
2 votes
0 answers
60 views

Do MV* architectural patterns apply not only to OO languages but also functional languages?

I am learning about MV* architectural patterns, thanks to the help from several answers here. I learned that they are used for designing the architectures of user interactive applications. I also ...
user avatar
  • 5,301
1 vote
1 answer
161 views

Question on MVP Pattern, Events and saving complex objects

I'm working on a winforms project that involves 3d models, Opengl graphics, hierarchical project files and uses an MVP approach. Currently i have things setup such that when the user manipulates ...
user avatar
4 votes
4 answers
789 views

Refactoring ASP.NET Web Forms App to use MVP vs incrementally rebuilding it using MVC?

My team has inherited a Web Forms application that was built over the past decade or so into a monolithic code base with massive dependencies. In order to maintain this system we are going to have to ...
user avatar
1 vote
1 answer
196 views

How to inform presenters of sub views of a main window about global data change in an MVC or MVP GUI app?

Suppose I'am writting a GUI desktop application which has a main window with a corresponding presenter. This main windows may host one or multiple panels which each also have their own presenter. The ...
user avatar
  • 27
3 votes
1 answer
207 views

Should MVP adapt the software framework, or just reside inside it?

In android there are many different implementations for MVP. Most of them favor to use the Activity or Fragment as the view, a few would make them presenters, and even less, would separate the ...
user avatar
  • 31
0 votes
1 answer
358 views

In The MVP architecture does the Activity or Fragment must be the View component?

In our team, we separate the UI logic from the Activity or fragment by creating a new class for the view and let the Activity/Fragment manage the Life Cycle only is this good practice or not? public ...
user avatar
2 votes
0 answers
212 views

Help with understanding/implementing MVP architecture in Android

I'm trying to decipher/understand the best way to implement Model-View-Presenter architecture for the following Android example app... The App: I'm attempting to implement a very basic weather app ...
user avatar
4 votes
1 answer
225 views

In MVP, should the View expose the controls themselves or just their values?

Let's say I have a TextBox in my View (in a Passive-View approach). Should it expose the TextBox object itself to the Presenter, or should it expose only the Text property of this object? Furthermore, ...
user avatar
0 votes
1 answer
462 views

In an n-layer architecture with MVP in the presentation layer, how the presentation layer interacts with the business layer?

I am pretty new to software architecture, and I am trying to understand the basic concepts of n-layer architecture and MVP (specifically Passive View). My current understanding of n-layer ...
user avatar
0 votes
1 answer
294 views

Model/Passive view/Presenter - Are one to many relationships between view and presenter valid?

I am maintaining an application that I refactored using the MVP pattern. I use the passive view pattern meaning my view is as dumb as possible only forwarding its events via its interface to my ...
user avatar
1 vote
1 answer
2k views

What is the correct way for one presenter to communicate to another presenter or view with the MVP pattern on Android?

I have an activity with two fragments attached, Fragment/View A controlled by Presenter A and Fragment/View B controlled by Presenter B. View A is on the top half of the screen and does not change ...
user avatar
0 votes
1 answer
804 views

MVP - Model Layer Architecture - Where and how to Setup Entities and DAO

I'm coding a "small" application using MVP pattern that gets it's data from a SQL database. I'm not using an ORM out of the box, and for the sake of learning, I'm writing my own simple ORM/DAO type ...
user avatar
  • 379
1 vote
1 answer
121 views

Is a Presentation potentially a god object?

I'm working on a project with a MVP architecture. My program revolve around forms that give rights to people. There are X differents forms depending on profiles ( so there are X differents profiles) I ...
user avatar
4 votes
1 answer
705 views

Model View Presenter pattern with passive view. Who is responsible for setting the labels' texts?

I try to work with the MVP Passive View pattern for the first time. I get the basics but some small things I still don't understand. My example : Imagine a simple view containing a textbox, a button ...
user avatar
2 votes
1 answer
106 views

In MVP Architecture, which layer should check the content of the fields?

My presentation has an Array which contain field names and their values. More precisely, each value is an object (like "User" for example) of the Model. I would like to know if the presentation ...
user avatar
32 votes
4 answers
15k views

Clean Architecture - Too many Use Case Classes

I'm going into Clean Architecture and lift my Android level from MVC to MVP, introducing DI with Dagger 2, Reactivity with RxJava 2, and of course Java 8. In MVP clean architecture there is a layer ...
user avatar
3 votes
1 answer
473 views

How to achieve proper MVP Android Dependency, between Presenter,Domain and Data Layer?

I am trying to understand better MVP Architecture on Android.To do that, i want to implement MVP on android project from beginning. First i tried to use one module, which is app(Application app),but ...
user avatar
  • 39
4 votes
1 answer
809 views

In MVP, should the View have access to Domain objects?

Let's say I have a form for representing a user. When pressing the "Save" button, should a User object be: constructed by the View based on the input, then passed to the Model via the Presenter and ...
user avatar
3 votes
1 answer
141 views

Should the presenter access view data via properties or event parameters?

I have a new-employee form. When the "Save" button is pressed, a SavingRequested event is raised. The Presenter gets an Employee object from the View and passes it to the Model for further processing....
user avatar
9 votes
1 answer
559 views

Patterns are not building blocks – so I shouldn't build an app on MVC/MVP patterns?

I've read this page about design patterns, and how you should treat them when writing your code. From my understanding, as the title in the link states: Patterns are not building blocks. If I ...
user avatar
1 vote
1 answer
317 views

how should the MVP pattern handle views created at runtime?

how should the MVP pattern handle views created at runtime ? for example There is a mainView (that has a model and presenter) that needs to display a list, each item in the list is represented by it'...
user avatar
  • 1,042
0 votes
1 answer
230 views

Which should subscribe to view events - the presenter or the view?

I have some Views and Presenters. In my architecture, they have a circular dependency, so the View has a reference to the Presenter and vice-versa. Now, which is the more commonly used: class View { ...
user avatar
4 votes
1 answer
1k views

In the MVP architecture, how should the Model layer get its data?

I am new to high-level (Android / Java) application development and I learned of the MVP (Model, View, Presenter) architecture. But it's not clear what the role and design of the Model layer is ...
user avatar
3 votes
0 answers
428 views

Where do I put WebSocket handling code following the MVP pattern?

I am currently working on a Web Application. One of the objectives is to use the MVP (Model View Presentation) Design Pattern. We would like to use WebSockets to communicate between client and the ...
user avatar
2 votes
1 answer
618 views

Good analogy for MVP and MVC patterns?

To be honest, I'm a student here, but I have seen many questions from teachers asking for ways to explain, and I have not found one for the MVP and MVC patterns. Model–view–presenter Model–view–...
user avatar
0 votes
1 answer
230 views

Underlying Container in View or Model in MVP

Implementing a Finance app, and one of the questions that came up is where to keep an underlying container? Right now I currently have these classes: class DataGrid : public View { /* widget stuff */...
user avatar
  • 1,159
0 votes
2 answers
1k views

Should events be handled in the Presenter/Controller?

Say I have an MVP app. Should the Presenter handle events raised by the view. For example, please see the code below: public void TextBox_TypeValidationCompleted(object sender, ...
user avatar
  • 6,865
3 votes
4 answers
713 views

Is it bad practice to have calculations in the Presenter/Controller and View

Say I have an MVP app. The form has four textboxes: Quantity Price Product TotalPrice The app calls a web service and then recommends products that may be cheaper based on the quantities being ...
user avatar
  • 6,865
1 vote
4 answers
1k views

Should an MVP/MVC Model contain behaviour?

I have read plenty of questions on here, which appear to confuse the MVP/MVC Model with the Domain Model. In my mind the MVP Model calls the Service, which then calls a rich Domain Model i.e. the MVC/...
user avatar
  • 6,865
7 votes
1 answer
3k views

How many presenters should I use in proper MVP?

I have an Android app which I am refactoring to use MVP. I have an Activity that has two Fragments. Scenario 1 (one presenter): The presenter "knows" each view. So, if one view receives input a ...
user avatar
3 votes
0 answers
1k views

Passive View (MVP design pattern) with multiple Views

Coming up to speed on the MVP design pattern and I have a gap in my understanding. The consensus seems to be to design a 1:1 relationship between Presenter and View. This makes sense -- but how would ...
user avatar
1 vote
2 answers
961 views

Update a combobox from a presenter (MVP)

I am using MVP in my project, but I am new in MVP. I have two comboboxes. When I select an option in a combobox, the other combobox should be filled with new data. This action will be done in the ...
user avatar
  • 27
4 votes
2 answers
3k views

In MVP, should we call repositories from the Model or the Presenter?

Note: The example in this question is for demonstration. Please focus on the question and not on problems in the example (such as tight coupling, lack of Dependency Injection etc.). I have a form to ...
user avatar
1 vote
0 answers
894 views

Architecturing my Android app with MVP design pattern

I am developing a Human Activity Recognition android application. Currently, I am at the Design stage where I am designing the architecture of the app. I am using the MVP architecture pattern. I have ...
user avatar
50 votes
2 answers
8k views

What are the improvements of MVP over MVC?

I have read for three days about the Model-View-Controller (MVC) and Model-View-Presenter (MVP) patterns. And there is one question that bothers me very much. Why did software designers invent MVP, ...
user avatar
  • 611
14 votes
1 answer
10k views

What is the difference between MVP and clean architecture

The question is self explanatory, just to add my thoughts : As far as I have read, The presentation layer in Clean arch has the same responsibility as in MV in MVP. How one decides to choose one ...
user avatar
0 votes
2 answers
429 views

Is it wrong to pass the concrete Model through the View to the Presenter with MVP 'Passive View'

I have tried to implement the Passive View MVP in my WinForms application as much as possible. The Presenter is the only one who uses the Model and the Presenter responds to events that are generated ...
user avatar
1 vote
1 answer
1k views

I have a few questions about the MVP pattern in a WinForms project

I hope someone can answer these. I have a WinForms project with +/- 8 forms. I have an SQLite database and a class that handles the queries to this database. I would like to use the passive View ...
user avatar
0 votes
1 answer
907 views

What layer does the presenter go in?

Whereas there seems to be a lot of information on the Internet about what the presenter both is and does, there doesn't seem to be a whole lot that specifically describes where to put it in a multi-...
user avatar
  • 3,055
2 votes
2 answers
676 views

Is 20 Java classes for just making a REST call too much?

In an Android project, I am using dagger 2 for dependency injection, applying mvp design pattern, and I am writing interface for almost every class. Although it does achieved the separation of ...
user avatar
  • 175
3 votes
2 answers
1k views

How to manage state in MVP pattern?

I am currently using MVP pattern to develop an android application. I have to implement pagination (i.e. on scrolling at the bottom of the RecyclerView I need to fetch new data). So what is the best ...
user avatar
  • 143
1 vote
0 answers
4k views

Can MVP be implemented in Android with Activities and Fragments as Presenters and Custom Views?

Lately my team has started considering the implementation of MVP pattern in some of our applications. We followed the several guides and tutorials out there, basically ending up with regular ...
user avatar
7 votes
3 answers
1k views

PHP MVC/PAC - Logged In/Admin checks placement

I have set-up a MVC/PAC-like structure for a web application (unsure if it fits any of these design patterns fully). In short it is: Routing in index.php, which selects the controller and method ...
user avatar