We got a request for a post on the Model-View-Presenter (MVP) pattern sometime back. As always, I did some digging and realized that there were very few examples of MVP that described its implementation well enough for someone to understand the subtleties of the pattern.
Subtle differences
Subtleties are the key issue with implementing presentation patterns. When I say subtleties, I mean much more that the how, of the implementation, but the why as well. Why would you want to implement an MVP architecture as opposed to an MVC? What are the potential advantages and disadvantages? I ended up comparing and contrasting GUI architectures such as MVP, MVC, Presentation Model, Supervising Controller and Passive View. When I found an example of an MVP, I found myself coming back to Martin Fowler’s work on Enterprise Application Architectures to iron out my doubts on the implementation. Fowler has not only done an excellent job of describing the differences between presentation patterns, but ties in the history and evolution of GUIs as well.
Separation of concerns
Separated presentation is a key theme in all GUI architectures. Much of the discussion on GUIs concentrate on separating the presentation layer elements, such as presentation logic and user-interface widgets, from the rest of the application. This separation is useful in that dependencies between the presentation layer and the rest of the application can be managed, allowing more effective development and testing. This is essential in Flash development because we deal with very rich GUIs that contain many complex UI widgets. Architecting the application to allow distributed modular development of the presentation layer can go a long way in streamlining the development workflow.
Walk-the-walk
This is the introductory post on a series of upcoming posts on presentation patterns where I take a mindful walk on the path carved out by Martin Fowler in his chapter on GUI Architectures. Mindful in the sense that I’m bringing a Flash and ActionScript mindset to the journey. This path has been traveled before, by Paul Williams. For contrast, I’ll be using the weather maps sample application from Chapter 12 in our book to provide a fresh set of examples on the following presentation patterns.
- The Classic Model-View-Controller ( MVC )
- Autonomous View
- Model-View-Presenter (MVP)
- Passive-View

The Separated Presentation: A series on presentation patterns by Chandima Cumaranatunge, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.

Bill Sanders
Awesome looking forward to the series
Hi
BillChandima,Sounds really interesting.
Looking forward to next post
Curro
Hi Curro & Roberto,
This is Chandima’s series! I’m still working on a guided tour of the State…
Cheers,
Bill
Hi
BillChandima,I’m always glad to see this blog updated and constantly with new informations. Thanks, Roberto.
Hi Chandima,
This is a very good subject. I often think that in our Flash / Flex apps, the view is the tier least discussed. All too often, a view becomes like a singularity where all the carefully laid rules break down, and separation of concerns get thrown out of the window — the view ends up as a bastard cocktail of mv and c, alongside more clearly defined application-wide model and controller (and service) tiers. I also think the Mediator is fundamental to any comparison of Presentation Patterns, though you didn’t mention it above. Will look foward to your next post.
Hi Pedr, I totally agree with your observations. I originally wanted to just compile a post on MVP and found myself really muddling through it with lots of unanswered questions. So, I’m digging really deep – going back to the roots, starting with the original MVC implementation in Smalltalk-80. Incidentally, Fowler doesn’t talk about mediators and presentation patterns in the same breath. However, the ‘Presenter’ in MVP, Passive View and others does some mediator type work. I’m looking forward to your critiques on the implementations.
Hi,
Sorry about the mistake.
Curro
Looking forward to those series. Was reading some of those things and features of WPF at summer. Very interesting stuff.
Hi Chandima,
Not sure of you have seen this: http://www.jeremydmiller.com/ppatterns/%28X%281%29S%28ghrjyk45v0mvrkiht2fotw45%29%29/MainPage.ashx
Some interesting bits and pieces.
Thanks for the link Pedr. The TOC indicates good coverage of PPs. The Separated Presentation section does look quite good. I’ll have to give all of it a patient read!