mvp

Implementing MVC/MVP Design for TabControl ..design question

Hi All, I have a an Winform application with 2 forms. In one form I have a Tab Control with 3 Tabs and navigation buttons to switch between tabs. On the first tab the user selects a file and on navigating to next tab i want to do some processing on the file selected in the first tab,and show the result in the 3rd tab. The other form j...

EventHandling in GWT with LayoutPanels

Hi all I have some questions regarding GWT (2.1) with MVP and events. Got DockLayoutPanel with some components in it. A Tree component to the west and a SimplePanel in center. Each component has a presenter and a view. The problem is that I want to handle the components events in their presenter class, but now they are only catchable ...

MVP Passive View Model

Should models be shared between controllers, so that two controllers have the same model, or should they listen to an global eventbus to get notice when the model is changed? ...

User Confirmation in MVP Pattern with Passive View

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? ...

Passive view in JavaScript

I'm thinking about an implementation of MVP - Passive View pattern in JavaScript. In most case the view will be simple dom elements where the presenter attaching event listeners. But when it comes to widgets like JavaScript based pseudo selectboxes, auto suggest or aria features, should this be part of a JavaScript view class or should ...

MVP: Should the View implement a Presenter's interface or vice versa?

I am doing my first steps with GWT. I have a question after reading: Large scale application development and MVP Large scale application development and MVP - Part II In the first example the Presenter defines the interface for the View. public class ContactsPresenter implements Presenter { ... public interface Display extends H...

How to handle selections in MVP/MVVM-backed GUI application

In a GUI app using MVP/MVVM, say the Presenter/ViewModel presents a list/collection, and one or more of the items can be selected at a time. Because other parts of the application could conceivably change as the selection changes, does the selection require its own Presenter/ViewModel? If not, how is selection best handled by a given Pre...

Model View Presenter - how to show selected item in a Drop Down List?

I'm using Model-View-Presenter framework. When Loading a page, I'm having trouble setting the selected item that came from the Database. In view, I know I need: protected void ddlStatus_SelectedIndexChanged(object sender, EventArgs e) { presenter.DdlStatusSelectedIndexChanged(); // what should this pass? } Then in Presenter: publi...

Failed to create an instance of Service via deferred binding

I have been trying to build a GWT / Google App Engine web app using the mvp4g framework. I keep getting an error about Failing to create an instance of my Service via deferred binding. My Acebankroll.gwt.xml file looks like: <?xml version="1.0" encoding="UTF-8"?> <module rename-to='acebankroll'> <inherits name='com.google.gwt.use...

Java Web Application Frameworks, keeping Mobile Phones in mind

There are about as many questions on this site about Java web application frameworks as there are frameworks themselves, but I'll try to make this question as specific as possible. I'm developing web applications to mirror my company's Java applications. (Unfortunately, they don't have pure presenter layers so I can't just make another ...

Issue With RhinoMocks - Can't Mock Return

Hello, I'm having a strange error trying to create a unit test. I'm trying to mock IPresenterFactory of the WebFormsMvp framework to force the return of a presenter. So I'm mocking it as: var view = ..; var presenter = new TestPresenter(view); var factory = mock.Stub<IPresenterFactory>(); factory.Expect(i => i.Create(null, null, null...

MVC Not Implementable in Winforms?

Based on the definition of classic MVC pattern, Controller is responsible for handling user inputs and interacting with Models and also determining which View to be rendered. Wikipedia definition of MVC: "The controller receives input and initiates a response by making calls on model objects. A controller accepts input from the us...

Am I implementing the MVP / Presentation Model UI pattern correctly?

I'm re-working a Winforms application and would like to employ a variation of the Presentation Model pattern for the UI. Could someone tell me from the following explanations if I'm doing it correctly? I have decided to set up dependencies as follows: Model <---- Presentation Model <---- View That is: The model is not aware of...

Refactoring Form.ShowDialog() code to MVP

Hi All, I have a WinForm and few properties that are set on it. for example : Name,Address are accepted on the Form. (many more properties in actual example) The current implementation is somewhat similar to frmName frmView = new frmName (); //frmName is WINFORM frmView.Name= "ABC"; //any valid string or read this from file frmV...

Model-View-Presenter and Transferring Large Objects

I have traditionally implemented a Model-View-Presenter [Passive View] like so: interface IView { string Title {set;} } class frmTextBox : Form, IView { ... public string Title { set { this.txtTitle.Text = value; } } ... } class frmLabel : Form, IView { ... public string Title { set { this.lblTitle.Text = value; } } ... } class Pres...

Application Controller and Application.Run() - Stop Program When UI Ends

I have an application controller with navigation workflow like so: namespace Ordering.UI.Workflow { public static class ApplicationController { private static INavigationWorkflow instance; private static string navigationArgument; public static void Register(INavigationWorkflow service) { ...

Implementation question of the Presenter in MVP

So..I intend to use a Model View Presenter(the "passive" mode, in which the UI is pretty dumb and sends all the events to the Presenter, and the Presenter takes care of dealing with the Model) to glue my domain's business logic and the UI. My question is how should my Presenter look like. Is this what I want? public class TicTacToeGame...

Sharing UI validation across the application

I have seen couple of discussion on where to write UI validation in MVP. There is quiet confusion over this as suggestion on keeping view and presenter. But displaying message box in presenter does not looks very good similarly putting logic in view restrict us from unit testing. One more aspect is Sharing validation across the applica...

asp.net mvp pattern. how easily move data from view into presenter

Hi, I am using mvp pattern in small project. I have problems with view which contains html table with data(always 9 rows). How can i easily get data from html table and send it to the presenter? On the model side i want to keep data from html table as a generic List<some_type> regards ...

Where to store the state in a MVP architecture

In other MVP-related questions on SO, people talk about the Presenter keeping the state information (could be session state or UI state). What I'm wondering is, since state is basically "transient data", and the Model's purpose is to encapsulate data access, can't state be kept inside the Model? Are there any rules of thumb or pros/cons ...