Microsoft Patterns and Practices released their MVP Bundle a few weeks back which diverges a bit from the other guidance bundles that we have seen in the past in that it is more about guidance on the Model-View-Presenter Pattern itself as opposed to providing any new controls and automation to help with web client development. I welcome guidance on proven practices in all its flavors, so I am happy p&p offers a good look at Model-View-Presenter using the WCSF as well as when not using the WCSF.
I have seen a few comments here and there from other developers on the MVP Bundle, but thought I would offer a more detail look at the quickstart examples by providing an MVP Bundle Screencast. I can’t believe I talked for 29 minutes, which is twice as long as I have and will ever talk again in a screencast, but I wanted to drive home a number of concepts that are and are not offered in the guidance.
With regard to the MVP Quickstarts that uses the Composite Web Application Block ( CWAB ), I wanted to show off a few things in the example:
The ever so cool Add View ( w/Presenter ) Recipe that automates a lot of manual effort.
The Dependency Injection Services built into the CWAB via an ObjectBuilder Container.
The new MasterPage, Page, and UserControl Base Classes added to hide dependency injection.
The ObjectContainerDataSource Control for MVP using UI components that use DataSource Controls.
With regard to the MVP Quickstart that does not include the CWAB, I wanted to highlight:
The lack of all features mentioned above.
The horribly bad practice shown of letting the View wire up the ContactsController and ContactsDataSource Classes and their dependencies.
The use of 3rd Party Dependency Injection Tools that could be used ( Windsor, Spring.NET, StructureMap ) for DI.
And with regard to both examples and the guidance in general, I wanted to highlight:
How a good mocking framework- RhinoMocks, TypeMock, etc. could alleviate some of the hand-coded mocks used in the Test Projects.
Differences between Supervising Controller and Passive View MVP.
The two types of View-Presenter Communication shown within the MVP Bundle:
View handles the events and passes requests to Presenter.
View publishes events and Presenter subscribes to those events.
If you watch the MVP Bundle Screencast and are looking for additional guidance on using MVP with the Web Client Software Factory, I recommend watching a previous screencast which dives into MVP via the WCSF in more detail:
If you are in the Tampa, Florida area on January 31, 2008 and have a whole day to spare, don’t forget the Day of Patterns & Practices Event that will be discussing:
Web Client Software Factory v2.0 Guidance Bundles
Service Factory: Modeling Edition
TDD and Model-View-Presenter
ASP.NET MVC Framework
Although we probably won’t cover the MVP Bundle directly, there will be plenty of talk throughout the day regarding Model-View-Presenter and Model-View-Controller Design Patterns. Pizza is provided for lunch and their is plenty of time after the event to discuss patterns & practices over your favorite beverage
I hope you enjoy the screencast and I apologize for it being a whopping 29 minutes. It won’t happen again