DotNetRocks #272 - Scott Cate on the MVP Pattern

posted on 09/14/07 at 10:27:40 pm by Joel Ross

I'm finally feeling like I'm starting to get caught up on podcasts after going about three weeks without listening to any. I haven't caught up on certain shows, but DotNetRocks is one of those that I prioritized to get caught up on. As of today, I'm all caught up.

Anyway, I wanted to highly recommend listening to episode #272 with Scott Cate. While I kind of felt the first 1/2 hour of the show was a commercial for Scott's company, the next half hour was a very good discussion of Model-View-Presenter, contract-based development and the design patterns needed to implement the first two.

I recently worked with a client using the Web Client Software Factory, which uses a MVP/MVC and I was intrigued by it - it's a different way to think about developing software. I'm still a little confused about MVP vs. MVC, mainly because I haven't had the time to really look into it, but I did build a sample application that had both a web and windows UI using MV[P/C] - the business layer had all of the logic in it, and both the UI's have basically no logic in them, and it works well. Scott says that it's not more code to do it - it's just a matter of where the code goes. I think he's right to an extent. I think setting it up is more work, but once you have the framework in place, it's not much more code. It just feels like more because there's more right clicking and adding files.

I also enjoyed the discussion towards the end about why you'd even do this if you don't need to have multiple UI's. This is when the discussion kind of changed to talking about my favorite design pattern: Inversion Of Control. The gist of the discussion? Once you've been burned by hard-coding dependencies, you quickly realize the benefit of IoC.

As an aside, I've always wanted to ask someone in an interview to explain Inversion of Control, Dependency Injection, and why you would choose one over the other. I probably never would ask that, but in case you're wondering, Martin Fowler has the answer.

Categories: Development, Podcasting, C#