mvp

User Confirmation in MVP Pattern with Passive View

最后都变了- 提交于 2019-12-12 03:41:43
问题 How would you handle calling a user confirmation dialog before continuing with a task in a web-based MVP pattern implementation? It'll have to do a postback in between and the confirmation would go out of the scope of the presenter function that called it. I'd prefer to keep to a pure MVP implementation but is it even possible? 回答1: You can't implement this logic in one single server-side function. I believe the standard approach to tackle this is either to Have multiple steps that each

Dynamically create members of interface

被刻印的时光 ゝ 提交于 2019-12-11 20:27:46
问题 I have a View, that implements an interface. I'm trying to unit test this, but it gets boring... The declaration is: public interface IView : IBaseView { TextBox ClientId { get; set; } TextBox ClientName { get; set; } Button SaveClient { get; set; } Button NextClient { get; set; } Button PreviousClient { get; set; } Button DiscardChanges {get;set;} bool ReadOnly { get; set; } ListBox MyLittleList { get; set; } } [Test] public void FirstSteps() { var sessionFactory = Substitute.For

Passing data to another controller using MVP pattern iOS

心不动则不痛 提交于 2019-12-11 18:06:42
问题 I am using MVP design pattern. I have two ways of passing data to the another view controller which I'll mention below. I don't know which of them is correct and doesn't violate MVP pattern. I know this is very big question but it's really very important. 1) Using init with presenter , below am creating the view controller by passing the presenter which the view controller needs. struct HotelTemplate { var id: String var name: String var icon: String } class ListHotelPresenter: NSObject {

Saving State Dynamic UserControls…Help!

牧云@^-^@ 提交于 2019-12-11 17:53:55
问题 I have page with a LinkButton on it that when clicked, I'd like to add a Usercontrol to the page. I need to be able to add/remove as many controls as the user would like. The Usercontrol consists of three dropdownlists. The first dropdownlist has it's auotpostback property set to true and hooks up the OnSelectedIndexChanged event that when fired will load the remaining two dropdownlists with the appropriate values. My problem is that no matter where I put the code in the host page, the

Allowing View To Use Presenter's Model Property For Databinding in MVP

≯℡__Kan透↙ 提交于 2019-12-11 17:00:33
问题 I have a Winform Model View Presenter (MVP) application which has a Presenter object passed in at instantiation time via an interface. The Presenter (ProductPresenter) has a model (ProductModel) property. I am allowing the View (ProductView) to access the ProductPresenter's ProductModel property to setup databinding. Below the ProductView is using its instance of ProductPresenter to access its ProductModel "City" property to setup a databind to a textbox control called textBoxCity on the

Getting Spring IOC to work with the MVP pattern

吃可爱长大的小学妹 提交于 2019-12-11 10:27:33
问题 I'm attempting to use the MVP design pattern with a Swing application in conjunction with Spring IOC. In MVP the View needs to pass itself into the Presenter, and I can't work out how to do this with Spring. public class MainView implements IMainView { private MainPresenter _presenter; public MainView() { _presenter = new MainPresenter(this,new MyService()); //I want something more like this // _presenter = BeanFactory.GetBean(MainPresenter.class); } } This is my config xml (incorrect) <bean

Where to place business logic in a Dagger/MVP app

廉价感情. 提交于 2019-12-11 07:53:01
问题 Having looked at a lot of Dagger demo apps, it isn't clear to me where business objects are placed. In a typical three tier app you have ui, business layer and data access layer. MVP is essentially a three tier architecture. Dagger deals with components and modules and I've seen demo apps place business logic in modules. But according to the MVP architecture, business logic belongs in the Presenter layer as this layers is suppose to act as bridge between the ui and model. Many of these demo

Application Architechture MVC,MVVM etc

混江龙づ霸主 提交于 2019-12-11 06:16:38
问题 Architecture patterns like MVC , MVVM , MVP are only used in presentation tier?. Can we use in Business Logic layer or Data access layer? I previously thought that Presentation Tier is View ; BusinessLogic Tier is Controller/Viewmodel and Data Access Layer is Model . please someone clarify this.. 回答1: The patterns you mention provide concepts to couple business and presentation tier. Considering a classical three tier architecture with the tiers you've mentioned: Data Access Layer , Business

Dagger and mvp - should presenter use dagger for injection

时光毁灭记忆、已成空白 提交于 2019-12-11 04:08:14
问题 I'm starting to think in mvp, dagger should not be used in the presenter. The usual way to construct dagger is using a global component and have subcomponents for scoping the graph. This global component will take an applicationContext as a parameter on creating the appmodule.java class usually. Having the application context given makes life easier. That's all fine but if I use a module from the global component or even a subcomponent, the context should be passed in. So that means if I

How to Moq this view?

杀马特。学长 韩版系。学妹 提交于 2019-12-11 03:30:21
问题 I have a view for which I'd like to mock the Show behaviour. Once the credentials have been entered, the [Connecter] button enables itself, and then the user can click. I wish I could reproduce this behaviour without having to show the view and actually really enter my credentials. The application is a WinForms MDI presented by the IApplicationPresenter . The IApplicationPresenter raises the ShowView to which the IApplicationView subscribed. Then, when the IApplicationView.Shown , the