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
4 votes
2 answers
294 views

Passing data through events to adhere to the Tell-Don't-Ask principle?

In my little WinForm app, intended to practice as a hobbyist, I'm using this code to pass data from the View to its Presenter: public event Action<object, string, string?>? SearchInAlbums; ...
Valmont's user avatar
  • 173
2 votes
1 answer
136 views

How to properly use Data Transfer Objects

I feel something is wrong with my approach handling MVP and the Repository Pattern. I'm making an album winform app just to practice MVP, crud and the Repos. Pattern. First some code. The model: using ...
Valmont's user avatar
  • 173
1 vote
2 answers
119 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 ...
George Z.'s user avatar
  • 705
-2 votes
2 answers
332 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 ...
rnm-kmdi's user avatar
0 votes
2 answers
112 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 ...
UsYer's user avatar
  • 37
1 vote
0 answers
181 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, ...
Lorenzo Felletti's user avatar
-3 votes
1 answer
238 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 ...
kyrpt's user avatar
  • 15
1 vote
1 answer
353 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 ...
Al2110's user avatar
  • 245
-6 votes
1 answer
78 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 & ...
product_n's user avatar
2 votes
0 answers
66 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 ...
Tim's user avatar
  • 5,415
1 vote
1 answer
184 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 ...
PeteByte's user avatar
4 votes
4 answers
875 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
284 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 ...
UsYer's user avatar
  • 37
3 votes
1 answer
219 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 ...
A.R.H's user avatar
  • 31
0 votes
1 answer
366 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 ...
Ayat Khrisat's user avatar
2 votes
0 answers
243 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 ...
DoTheDonkeyKonga's user avatar
4 votes
1 answer
247 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, ...
Michael Haddad's user avatar
0 votes
1 answer
554 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 ...
Michael Haddad's user avatar
0 votes
1 answer
371 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 ...
selmaohneh's 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 ...
user308756's user avatar
0 votes
1 answer
960 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 ...
GisMofx's user avatar
  • 379
1 vote
1 answer
122 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 ...
Freddykong's user avatar
4 votes
1 answer
856 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 ...
selmaohneh's user avatar
2 votes
1 answer
119 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 ...
Freddykong's user avatar
35 votes
4 answers
19k 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 ...
Jackie Degl'Innocenti's user avatar
3 votes
1 answer
504 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 ...
Bokch's user avatar
  • 39
4 votes
1 answer
957 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 ...
Michael Haddad's user avatar
3 votes
1 answer
201 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....
Michael Haddad's user avatar
9 votes
1 answer
566 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
383 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'...
user1450877's user avatar
  • 1,052
0 votes
1 answer
273 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 { ...
Michael Haddad's user avatar
4 votes
1 answer
2k 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 ...
ForlornGeas's user avatar
3 votes
0 answers
488 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 ...
Freddykong's user avatar
2 votes
1 answer
669 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–...
Dragonturtle's user avatar
0 votes
1 answer
236 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 */...
keelerjr12's user avatar
  • 1,199
0 votes
2 answers
2k 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, ...
w0051977's user avatar
  • 7,031
3 votes
4 answers
801 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 ...
w0051977's user avatar
  • 7,031
0 votes
4 answers
2k 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/...
w0051977's user avatar
  • 7,031
7 votes
1 answer
4k 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 ...
Willi Mentzel's user avatar
4 votes
0 answers
2k 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 ...
user590028's user avatar
1 vote
2 answers
1k 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 ...
Mohsen's user avatar
  • 27
5 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 ...
Michael Haddad's user avatar
1 vote
0 answers
952 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 ...
Georgi Koemdzhiev's 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, ...
Victor's user avatar
  • 611
14 votes
1 answer
11k 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 ...
Mehrdad Shokri's user avatar
0 votes
2 answers
458 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 ...
Marthe Veldhuis's 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 ...
Marthe Veldhuis's user avatar
0 votes
1 answer
1k 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-...
Panzercrisis's user avatar
  • 3,145
2 votes
2 answers
686 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 ...
s-hunter's user avatar
  • 185
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 ...
Sushant's user avatar
  • 143