End of Confusion: MVP vs MVC

10 בנובמבר 2007

5 תגובות

The Model View Controller and Model View Presenter design pattern has been the source for a lot of confusion.  Lately there has been a growing number of blog posts attempting to explain the when, what and why of this design pattern. Many developers unfamiliar to this pattern seem to be pushed back by the initial learning curve and complexity.

I have been following much of what has been written on this topic both on online forums and on blogs. If you are unfamiliar with MVP and are doing UI development I would strongly urge you to evaluate and study this pattern. It does not always pay to implement it and there are several flavors of MVP. Each flavor has strengths and weaknesses. But, IMHO, if you develop user interfaces, you need to be familiar with this design pattern.

If you are new to design patterns in general, there is one personal message that I would like to emphasize. I was first introduced to Design Patterns several years ago. It was early in my career, but I was no longer a junior programmer. Full of confidence I dived into this topic that was supposed to make me a better developer. There was however a difficulty I had to overcome that I would like to share.

I had mostly been working on medium sized projects. My interpretation of medium size is more than 6 months of development with 3-6 developers. Most, if not all of us were familiar with the principles of writing cohesive code and low coupling. The code was modular, well managed and in general I felt that for the most part it was high quality code.

At this point I was introduced to design patterns. My main problem was that it took significant time to unlearn certain practices I was familiar with. It took time to grok what all this extra complexity would bring to the table. And this is the main point. Until you become familiar with certain ways of doing things, it is pure added complexity. Once you get past this point and start to follow a set of principles and design patterns you'll find yourself writing highly consistent code. What was previously complex becomes second nature.

Back to the topic on Model View Presenter. As I stated in the beginning of this post, a lot has been written on this topic lately. Instead of repeating what others have written I'll instead point you to the sources I have enjoyed most.

Jeremy Miller has written a lot on the topic of Model View Presenter and Design Patterns in general. Development Trivial Pursuit: The difference between MVC and the different flavors of MVP is a pretty recent post, but if you search his blog you'll find tons of good content.

In his post MVC or MVP Pattern – What's the difference? Todd Snyder from Infragistics gives a good overview and compare and contrast the two.

Nicola Malovic offers a two part introduction to MVP. Part 1: Model View Presenter (MVP) Pattern Part 2: Model View Presenter (MVP) design pattern close look – Part 2 – Passive View.

If you want a lengthy, but thorough introduction and historical evolution of this pattern head over to An Introduction to the Model-View-Controller, Model-View-Presenter, and Presentation-Abstraction-Control Patterns by Derek Greer.

 


Share this post : digg it! dotnetkicks it! reddit!

הוסף תגובה
facebook linkedin twitter email

כתיבת תגובה

האימייל לא יוצג באתר. (*) שדות חובה מסומנים

5 תגובות

  1. Mariano25 ביוני 2011 ב 19:57

    What a waste of time. The entire article just talk about your problems and life history. When it comes to actually content your forward people to someone else material.

    להגיב
  2. Vikas17 בינואר 2012 ב 17:49

    Instead of taling about yourself talk abot technical topic on which you want to put you feedback.. My time got killed..

    להגיב
  3. Chelsea 28 במרץ 2012 ב 9:49

    So-so. Something was not impressed.

    להגיב
  4. Doug1 בדצמבר 2012 ב 0:44

    Bit late to the party, but if it takes you so long to read three paragraphs that aren't square on topic that you feel the need to attack the author you may have bigger problems.

    Also, would you speak to someone like that in pereson? I doubt it.

    להגיב