mvp

What are MVP and MVC and what is the difference?

When looking beyond the RAD (drag-drop and configure) way of building User Interfaces that many tools encourage you are likely to come across 2 design patterns called Model-View-Controller and Model-View-Presenter. My question has two parts to it: What issues do these patterns address? How are they similar? How are they different?...

How Do You Communicate Service Layer Messages/Errors to Higher Layers Using MVP?

I'm currently writing an ASP.Net app from the UI down. I'm implementing an MVP architecture because I'm sick of Winforms and wanted something that had a better separation of concerns. So with MVP, the Presenter handles events raised by the View. Here's some code that I have in place to deal with the creation of users: public class Crea...

Using MVP - How to use Events Properly for Testing

I've just started using the MVP pattern in the large ASP.NET application that I'm building (re-building actually) and I am having a hard time figuring out how I should be using Events applied to the view. Say I have 2 drop down lists in a User Control, where one is dependent on the other's value: <%@ Control Language="vb" AutoEventWire...

When Testing your MVC-based UI, how much of the test setup do you make common?

I'm trying to test a simple WebForms (asp.net) based UI, and follow the MVP pattern to allow my UI to be more testable. As I follow the TDD methodology for backend algorithms, I find that there are some unit test refactorings that happen in the spirit of the DRY principle (Don't Repeat Yourself). As I try to apply this to the UI using ...

Silverlight 2 and the MVP Pattern

Any ideas on how i get MVP working with Silverlight? How Do I get around the fact there is no load event raised? This the view I have: public partial class Person: IPersonView { public event RoutedEventHandler Loaded; public Person() { new PersonPresenter(this); InitializeCompo...

How do I integrate the ASP .Net Model View Presenter (MVP) pattern and static page methods marked as [WebMethod]?

In an asp.net application, I would like to combine the use of the Webclient Software Factory (WCSF), and its associated Model View Presenter pattern (MVP), with Page Method, that is static methods on the .aspx Views marked with the [WebMethod] attribute. However, static methods on the aspx page would seem to break the Model View Presen...

MVP pattern - Passive View and exposing complex types through IView (Asp.Net, Web Forms)

Hi, I've recently switch to MVP pattern with a Passive View approach. I feel it very comfortable to work with when the view interface exposes only basic clr types, such as string mapped to TextBoxes, IDictionary mapped to DropDownLists, IEnumerable mapped to some grids, repeaters. However, this last approach works only when from those...

WinForms: Implementation question for having my UI run independently of my BLL layer?

I am trying to do a Windows Forms application in an MVP style and - not having done much with threading before - am getting all confused. My UI is a set of very simple forms. Each of the forms implements an interface and contains a reference to a mediator class which lives in the Business Logic Layer and vice versa. So as simplified di...

Should new web applications follow the MVC or MVP pattern?

Note that I am not asking which to choose (MVC or MVP), but rather if one of the two should be used for a web application. I realize that it might be too much work to convert an older application from its current design to a MVC or MVP pattern. However, what about for a new app? It appears these are the most popular architecture pattern...

What design patterns have you used in your WPF efforts and which do you like?

I have been looking at the Model-View-ViewModel pattern that is suggested by several people out there (especially John Gossman, take a look at this post and this podcast), but what other patterns (if any) have people used and liked ... and where do they add value? I have also stumbled across: Model-View-ViewModel Presentation Model Da...

Winforms - MVP examples

Does anyone have a good example code or test project for explaining someone MVP pattern. There are a lot of explanation links but i want to have some good example code to show others without reinventing the wheel. ...

Do you buy the reuse story for the presentation layer in MVP and its variations?

Besides the unit testing benefits, what I heard regarding MVP pattern was that the reusability of the presentation layer. So, you would design one presentation layer and use it for WinForms (rich) and Web. I am currently working on a windows forms application in .NET with possibility of creating a web UI in the future. However, when I...

MVP dependency injection

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

Model - View - Presenter with Virtual Grid

What is the best breakdown of responsibility when using a virtual grid and the MVP pattern in a winforms application. including: Getting callbacks from the grid on user changed cell updates Callback from the grid to set the style and value of a cell given a row and column ...

Directories or projects . .

On a regular winforms solutions, how do you determine to break classes into different directories / namespaces or seperate projects. Besides binary dependencies should view, controllers, models all be in different projects ? ...

Structuring a winforms C# solution

So i am reorganizing a winforms C# solution to help decouple and make it cleaner and more organized. The solution tracks a small business orders,etc . . I have broken out the projects so far into App.View - all GUI Related Code App.Data - just data structures and interfaces. No other implementation code App.BusinessLogic - all busines...

In MVP where to write validations

In Model-View-Presenter pattern where should we write validations of user input. ...

ASP.NET Model View Presenter project structure

I am just starting a new ASP.NET project and using the MVP pattern. I did consider the MS MVC but it is not released yet and would be a big learning curve for some people on the team, so I opted for MVP now and possibly future projects MVC. Anyway, it seems I will have a single Controller/Presenter class for every webform I have it the ...

Silverlight 2 UI pattern

I have to build small (for now) admin app in Silverlight2, and would like to use some pattern for binding UI with my BL/DAL. I found view-model-viewmodel and mvp/mvc patterns, where first one (V/M/VM) is specially suited for WPF apps, because it uses rich capabilities of WPF data-binding options. What do you suggest? Can you write simple...

MVP events or property

I'm using the MVP pattern in a windows form app. I need to change a radio button on the view. I can do this by exposing a Boolean property on the view, but should I be using events to manipulate the view instead? ...