Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

-2
votes
0answers
16 views

Which App Architecture would suit best for a comprehensive Photo Editor App?

I have a very comprehensive Photo Editor App that I need to refactor the code to make it more reusable, testable etc. Since I am really ignorant about the subject it is really hard to choose which ...
0
votes
1answer
28 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 ...
2
votes
0answers
35 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 ...
4
votes
1answer
151 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, ...
0
votes
1answer
55 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 ...
0
votes
1answer
114 views

MVP (Model-View-Presenter) Drawing Application

I'm trying to make a simple drawing application with the MVP pattern. Let's consider I want to be able to draw a circle and drag (move) the circle around on a JPanel. After the drag, the model should ...
0
votes
1answer
59 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 ...
1
vote
1answer
231 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 ...
0
votes
1answer
237 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 ...
0
votes
0answers
128 views

MVP pattern with multithreading

I'm writing a small application using the model-view-presenter pattern (forgoing the model entirely as it's pretty basic). I started off with a passive view, in which the presenter did all of the ...
1
vote
1answer
100 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 ...
2
votes
1answer
194 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 ...
2
votes
1answer
67 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 ...
6
votes
2answers
2k 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 ...
2
votes
1answer
308 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 ...
4
votes
1answer
239 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 ...
3
votes
1answer
109 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....
9
votes
1answer
397 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 ...
1
vote
1answer
169 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'...
0
votes
1answer
129 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 { ...
3
votes
1answer
762 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 ...
2
votes
0answers
221 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 ...
2
votes
1answer
370 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–...
0
votes
1answer
172 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 */...
0
votes
2answers
484 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, ...
3
votes
4answers
369 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 ...
1
vote
4answers
658 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/...
4
votes
1answer
1k 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 ...
3
votes
0answers
616 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 ...
1
vote
2answers
561 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 ...
4
votes
2answers
1k 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 ...
1
vote
0answers
415 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 ...
49
votes
2answers
6k 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, ...
13
votes
1answer
4k 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 ...
0
votes
2answers
214 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 ...
1
vote
1answer
797 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 ...
0
votes
1answer
512 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-...
2
votes
2answers
560 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 ...
3
votes
2answers
872 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 ...
1
vote
0answers
3k 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 ...
8
votes
3answers
592 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 ...
9
votes
2answers
2k views

MVP (Supervising Controller) Does the view update the model?

I've been reading about MVP, specifically Supervising Controller. One thing I'm having difficulty wrapping my head around is how the View interacts with the Model. It was my understanding that the ...
5
votes
3answers
2k views

In the MVP pattern, the Presenter must control the call flow of Model methods?

I have a Presenter ( RoomPresenter) and a Model ( RoomModel). My RoomModel have some methods like: void createRoom(RoomData roomData, List<User> users) void addUsersToRoom(int roomId, List<...
3
votes
2answers
279 views

How to use the MVP pattern in embedded systems?

I am defining the architecture for an embedded system provided with an LCD touch screen for interacting with the user. To describe my problem I can use a washing machine provided with LCD touch screen ...
8
votes
1answer
4k views

In MVP pattern should the View instantiate a Model object based on UI contents, or just pass these contents as parameters to the Presenter?

I'm using MVP pattern in an android app that I'm developing. I have basically 4 elements: The AddUserView where a new user can be added: The AddUserPresenter The UserInfo (the pojo) The ...
3
votes
1answer
907 views

Understanding MVP pattern usage in Android

In my current android projects I'm using a sqlite db to store my collections of structured data. The database is accessed by a ContentProvider called by a Loader which updates the UI. It looks like ...
5
votes
1answer
2k views

Who communicates with the database in MVC/MVP?

I am building a small application and want to save my business objects to a database. I have my business objects and a model that acts as a container for my business objects and provides methods for ...
1
vote
1answer
887 views

Why are interfaces necessary in MVP design pattern?

I am trying to understands MVP using Winforms. I found this example. Why do UserModel and UserView need to implement the IUserModel and IUserView interfaces ?
2
votes
1answer
593 views

Is IntentService an implementation of Command Pattern?

According to Wikipedia: In object-oriented programming, the command pattern is a behavioral design pattern in which an object is used to encapsulate all information needed to perform an action or ...
1
vote
2answers
194 views

A proper way to work with MVC

I got into a debate at work today, I hope you can help me to settle it up. My colleague wants to separate UI, Model, DB, and Network like so: Create an API level between UI and controller, that will ...