mvp

In MVC, MVP and MVVM the model could it be a collection of entities?

▼魔方 西西 提交于 2019-12-23 00:41:42
问题 I try to understand what a Model is. I already read this answer. In MVC, MVP and MVVM the model could it be a collection of entities? 回答1: Absolutely. A Model is all what describes a data used by business logic. Ofthen in MVVM Model is encapsulated by the appropriate ViewModel itself. You need to separate a Model layer from ViewModel in case when different models could be handled by a single ViewModel. 回答2: Sure it could, I think of a model as a collection of properties that are used to

Applying Dependency Injection on an ASP.NET web forms application built using MVP Pattern

梦想与她 提交于 2019-12-22 09:39:40
问题 I am creating an ASP.NET Web forms application with MVP pattern. The structure of my view is something like this: public partial class ShipperView : System.Web.UI.Page, IShipperView { ShipperPresenter presenter; public ShipperOperationsView() { IShipperOperations operations = new ShipperOperations(); INavigator navigator = new Navigator(); presenter = new ShipperPresenter(this,operations,navigator); //Instantiating presenter } ... } The basic structure of my presenter is something like this:

Should I unit-test my view in MVP(or VM) or how to keep the code in the view to a minimum?

对着背影说爱祢 提交于 2019-12-22 09:26:07
问题 I use Model-View-Presentation Model in my application and I am wondering whether I need to create unit tests for the view. (I am on .net 2.0 WinForms) Now typically the view should be so simple that it should not be necessary to create unit tests for it. At least that's the idea I got from the goal of having the separation of View vs. Presentation Model (PM). And for the most part that is true in my code as well. However, there are cases where I can't seem to avoid some logic in the view.

How many presenters should be used in Model View Presenter with Winforms with tabs?

女生的网名这么多〃 提交于 2019-12-22 08:54:47
问题 I have a form with tabs related to a business entity - e.g. a Person has biographical data, address data, etc. Each tab handles input/editing of a category of Person data, and each tab can be saved independently. Should one presenter be used for all tabs, or one presenter per tab? There may also be a main tab, which can navigate to the other tabs (based on category of data selected). 回答1: I create one presenter per view. If each tab is a separate view, then each tab would have it's own

Decoupling the view, presentation and ASP.NET Web Forms

风格不统一 提交于 2019-12-22 05:59:21
问题 I have an ASP.NET Web Forms page which the presenter needs to populate with controls. This interaction is somewhat sensitive to the page-life cycle and I was wondering if there's a trick to it, that I don't know about. I wanna be practical about the whole thing but not compromise testability. Currently I have this: public interface ISomeContract { void InstantiateIn(System.Web.UI.Control container); } This contract has a dependency on System.Web.UI.Control and I need that to be able to do

Decoupling the view, presentation and ASP.NET Web Forms

家住魔仙堡 提交于 2019-12-22 05:59:11
问题 I have an ASP.NET Web Forms page which the presenter needs to populate with controls. This interaction is somewhat sensitive to the page-life cycle and I was wondering if there's a trick to it, that I don't know about. I wanna be practical about the whole thing but not compromise testability. Currently I have this: public interface ISomeContract { void InstantiateIn(System.Web.UI.Control container); } This contract has a dependency on System.Web.UI.Control and I need that to be able to do

MVP - Should views be able to call presenter methods directly or should they always raise events?

痴心易碎 提交于 2019-12-21 23:00:35
问题 I've been using the MVP pattern for a while with ASP.NET. I've stuck to the defined pattern of raising presenter events from the view. It has struck me that I could expose methods in the presenter that the view could call directly. Technically, using direct methods calls would require less code. The other benefit is that I tend to share presenters across multiple views that offer similar functionality. This means that sometimes some of the event handlers are forced to be registered in a view,

communicate between presenters in MVP android application

江枫思渺然 提交于 2019-12-21 09:18:29
问题 I am using MVP pattern to build a small test android app. I have two fragments Fragment B (I am using for sliding drawer) and Fragment A (main fragment). Both fragments have their own presenters. when I click on sliding draw it should send message or invoke a method in Fragment A to update view. I want to ask , how both fragments presenter can talk under MVP. I know other solutions but I want to do it through MVP pattern. Please suggest some options that MVP pattern follows to deal such

communicate between presenters in MVP android application

左心房为你撑大大i 提交于 2019-12-21 09:18:03
问题 I am using MVP pattern to build a small test android app. I have two fragments Fragment B (I am using for sliding drawer) and Fragment A (main fragment). Both fragments have their own presenters. when I click on sliding draw it should send message or invoke a method in Fragment A to update view. I want to ask , how both fragments presenter can talk under MVP. I know other solutions but I want to do it through MVP pattern. Please suggest some options that MVP pattern follows to deal such

How to apply composition in android MVP?

喜夏-厌秋 提交于 2019-12-21 09:17:33
问题 Recently I took over an android project which is built on top of MVP. While simple screens are quite straight forward and easy to read and maintain, the more complex parts of the app are not. Multiple inheritance levels have caused me days of switching between classes, trying to find out how the information flow is actually working. Here one example of the more problematic hierarchies: Since we use MVP, naturally there is another presenter class and another view class for each of the classes