mvp

ASP.NET MVP and AJAX posting/webservices

纵然是瞬间 提交于 2019-12-21 06:28:14
问题 When applying the MVP pattern to ASP.NET applications, where does using AJAX to post data fit? Of what I know of the MVP pattern, the UI is simply that(appearance), and all the heavy lifting is done in the presenter. I don't see how you could follow the pattern and still use AJAX interacting with web services on the client. Does anyone have any references as to how one can use AJAX and web services and still follow the MVP pattern? Thanks! 回答1: I use the same approach with AJAX as with a

Pass bundle intent in android using MVP

人盡茶涼 提交于 2019-12-21 04:58:24
问题 I want to pass the Model data into another activity using Parceler through Bundle intent. My problem is how could I pass the data from Presenter into the View layer to display in another activity using MVP architecture in android? 回答1: This is certainly possible. Presuming that your Activity implements your View interface you'd have a method in the interface like: void startNextActivity(MyData data); Then in the Activity: @Override void startNextActivity(MyData data) { // create bundle //

MVC or MVP? Which design pattern makes the most sense?

◇◆丶佛笑我妖孽 提交于 2019-12-21 02:38:06
问题 Which do you guys prefer? I've been looking into both and there definitely seems to be some inconsistency in what people call them. I will try and jot down what the differences are and you can correct me if I'm wrong. MVC Model holds references to it's own observers (Views), on updates to the model it notifies observers. Views pass all events and messages to the Controller. Views update their content when they are notified by the model that a change has occured. View holds a reference to the

MVP in Winforms

南楼画角 提交于 2019-12-20 14:09:45
问题 I'm primarily from an ASP.Net background with some MVC. I've also done a little Silverlight and MVVM, however I'm now about to move into Winforms which I have very little experience of, so I'm wondering how to tackle MVP. Typical MVP samples show the presenter setting a view property (via some kind of IView interface), with the concrete view putting that property value into a textbox for example. Instead of this archaic approach, can one utilise INotifyPropertyChanged in MVP, and if so how? A

MVP in Winforms

淺唱寂寞╮ 提交于 2019-12-20 14:09:21
问题 I'm primarily from an ASP.Net background with some MVC. I've also done a little Silverlight and MVVM, however I'm now about to move into Winforms which I have very little experience of, so I'm wondering how to tackle MVP. Typical MVP samples show the presenter setting a view property (via some kind of IView interface), with the concrete view putting that property value into a textbox for example. Instead of this archaic approach, can one utilise INotifyPropertyChanged in MVP, and if so how? A

WPF: MVP vs MVVM

一笑奈何 提交于 2019-12-20 11:53:10
问题 What is the difference between MVP VS MVVM? Why we are using MVP even though we have three layers: business, data access and presentation? Is there any specific reason to divide the Presentation layer into MVP? 回答1: MVP and MVVM are both derivatives of MVC. MVC is a pattern that separates the user presentation and interaction from the internal representation. This requires three layers, since tying the user interaction/presentation directly to the internal representation will cause both to

MVP dependency injection

这一生的挚爱 提交于 2019-12-20 08:30:39
问题 using MVP, what is the normal order of construction and dependency injection. normally you create a presenter for each view and pass the view into the presenter on constructor. But what if you have: A Service that multiple views need to listen to events on. Multiple views all pointing to the same data model cache. can someone display a normal flow of info from a user click to data coming back in a service from a server. 回答1: Here is what I do: First, I define theses interfaces: public

MVP Design for Android: How to adopt to my application?

我怕爱的太早我们不能终老 提交于 2019-12-20 06:00:46
问题 I am writing an application that will have a JSON file which contains data that should be parsed and saved into ItemModel POJOs. Let's assume for now I have a simple Activity that displays nothing at all - all I want my application to do is on startup parse the JSON and create the model objects (I'd like to figure out the basic architecture of these pieces before moving onto bigger/better things). I'd like to unit test this code before making any UI components to ensure my model classes are

Using Autofac with ASP.NET and the MVP pattern

假如想象 提交于 2019-12-19 11:51:25
问题 I'm trying to integrate Autofac into an exsisting ASP.NET web application. The pages follow the MVP pattern. Each page implements a View and delegate functionality to a Presenter. The View is injected into the Presenter thru the constructor. I was able to register the Presenter and View and the page loads fine but when a postback happens the user controls on the view are null. It seems that Autofac creates a new instance of the Page to give to the presenter instead of giving it the instance

Unbinding presenters necessary in GWT

吃可爱长大的小学妹 提交于 2019-12-19 07:22:19
问题 I'm using the MVP pattern from my GWT application following the example given here http://code.google.com/webtoolkit/doc/latest/tutorial/mvp-architecture.html I have a single MainPresenter and sub-presenter for each of the panels in the MainView. To show a new sub-presenter, I do something like this: presenter = new PresenterA(new ViewA(), ....); presenter.go(panel) // presenter clears the panel and itself to the panel When PresenterA is created, it binds itself to events in the ViewA . My