Netflix Movie App

There’s hasn’t been much going on at work lately, so I thought I’d spend some time learning something new.  For me to “play” with something new, I need something interesting to code for which is where Netflix comes into play.  I discovered the Netflix API which allows anyone to access their database of movie information.  You can access the data from several different ways depending on what kind of information you need.  You have the power to access & modify your movie queue or just get information about movies like descriptions, actors, release dates, etc.

I think I’m going to work towards writing an app using the MVP pattern for a Windows Form and WPF UI that shows movie box art.  I’m pretty familiar with both, but I figure I can use the application as a starting place to learn other languages that I’m less familiar with.

MVP vs. MVC Patterns

I recently read an article that mentioned the Model View Presenter MVP pattern.  This was the first time I’ve seen a reference to this pattern and was curious how it was different than the Model View Controller MVC pattern.  The article below offers a great explanation of the two as well as the differences.

http://blogs.infragistics.com/blogs/todd_snyder/archive/2007/10/17/mvc-or-mvp-pattern-whats-the-difference.aspx

Here’s the MVP pattern:

And the MVC Pattern:

Key Differences

So what really are the differences between the MVC and MVP pattern. Actually there are not a whole lot of differences between them. Both patterns focus on separating responsibility across multi components and promote loosely coupling the UI (View) from the business layer (Model).  The major differences are how the pattern is implemented and in some advanced scenarios you need both presenters and controllers.

Here are the key differences between the patterns:

  • MVP Pattern
    • View is more loosely coupled to the model. The presenter is responsible for binding the model to the view.
    • Easier to unit test because interaction with the view is through an interface
    • Usually view to presenter map one to one. Complex views may have multi presenters.
  • MVC Pattern
    • Controller are based on behaviors and can be shared across views
    • Can be responsible for determining which view to display (Front Controller Pattern)

Hopefully you found this post interesting and it helped clarify the differences between the MVC and MVP pattern. If not, do not be discouraged patterns are powerful tools that can be hard to use sometimes. One thing to remember is that a pattern is a blue print and not an out of the box solutions. Developers should use them as a guide and modify the implementation according to their problem domain.