Posts Tagged mvp

Some thoughts on the Virtual Brown Bag meeting for October 14th 2010

Another Thursday, another fun Virtual Brown Bag. JB shared some more Rails/Heroku love today, and how he’s implemented the registration/login feature of http://www.virtualbrownbag.com. The more I hear and see things about Rails/Heroku, the more I like it. I need to find me some time to start messing with those things.

We had a special request from Mark, one of our frequent VBBers: he wanted to see a little example of MVVM, and maybe have a little talk on MVC.

I showed a very simplistic sample of a WPF app, where we started with having most of the code in a code-behind for a window, and then moving the code out into a ViewModel. We’ve covered the core differences between MVC (Model-View-Controller), MVP (Model-View-Presenter), and MVVM (Model-View-ViewModel, or also known as Presentation Model). The idea bein  g that they’re all “presentation patterns”, aimed to better structure the code that sits closer to the User Interface.

CL[4]

So why so many different patterns just for that? Well, each one has a slight different structure to cater for the scenario have at hand. In MVP, the Presenter takes care of providing behavior to the View. The View does nothing more than delegating things to the Presenter. This allows the Presenter to be reused independently of the View, and it’s also testable.

In MVVM, the ViewModel gives shape to the data coming from the Model, tailoring it to the View needs. For instance, the Model may have separate properties for Address, City, State, whereas the View calls for just a single property representing the Full Address; the ViewModel will handle just massaging of the data. ViewModels fit in nicely with WPF/Silverlight due to their data binding features.

In MVC, the Controller is usually the one responsible for executing behavior, and in web applications the Controller is usually the point of entry for the user to execute operations: when the user either enters a URL in the browser directly, or clicks something on the page that sends a request to the server, there’s a Controller intercepts the call and takes the appropriate action.

ViewModels are commonly used in MVC applications as well, but different than in WPF/Silverlight applications, they only provide the “data reshaping” aspect of it.

Even on a MVVM WPF/Silverlight application you may find “Controllers”, usually helping out with the way the application flows through menus and screens.

MVP is usually the best bet for WinForms and WebForms applications. So why not use MVVM in a WinForms application? Because MVVM leverages the WPF/Silverlight data binding capabilities, which in WinForms aren’t that great.

As with all design patterns, there isn’t one presentation pattern that’s the silver bullet to all applications. Depending on context, requirements, etc., a single application may mix and match these patterns: have a Login screen implemented using MVP, whereas an order placement screen may be implemented using MVVP, whereas a more complex composite screen may be using MVVM with a Controller added to handle the flow between the different parts of the screen.

This post isn’t supposed to be nothing more than a brain dump as to what we’ve discussed at the Virtual Brown Bag this week. Please make sure to take the time and go do some research and experimentation on your own.

Advertisements

, , , ,

3 Comments

That MVP Thing…

Every once in a while I get people asking me "what it takes to become an MVP", or "what is this MVP thing…". I just ran accross this article that provides some good information about it:
 
 
It has also some good historical information about the MVP program that I didn’t even know about (even though I’ve been awarded consecutively over the last 6 years). For example, I didn’t know that out of the 38 MVPs from the first year when the program started, 30 of them were FoxPro MVPs.

2 Comments

From the Tulsa CodeCamp to Seattle for the MVP Summit

Oh boy, some busy days around here…
 
Yesterday I spent the day at Tulsa for the CodeCamp. I got some great feedback from my keynote on LINQ (there’s no way to not get hooked by the thing…), and also great feedback on the OOP session (that one people seems to always enjoy). On the WPF session I sort of struggled with my laptop since it’s kind of an old box, so things were pretty slow…
 
Overall, I really enjoyed the event and the people I’ve met over there, and I’m looking forward to go back there for any future events. Kudos to David Walker (http://aspadvice.com/blogs/davidwalker/default.aspx), who’s done a great work putting this event together!
 
Then, this morning I woke up at 4:30am to catch a flight back to Houston, and then from Houston to Seattle. When the plane was getting to Houston, the city was fogged, with zero visibility, so we couldn’t land. We stayed going around up there for an hour waiting, but it didn’t get any better, so we had to land in Austin to refuel and wait until we could land in Houston. My fligh in Houston would take off at 9:15am, and we got there after 11am, so of course I missed the plane and had to get into the stand-by line for the next flight at 12:20pm; I was lucky to get a seat, but ended up not making to Rod’s barbecue. Oh well, there’s always next time.  🙂
 
On the evening I went to the party Jeffrey Palermo put together, and it was great; got to meet a lot of old friends and got to meet new ones. This is one of the best part of coming to the MVP Summit; getting together with these guys. Plus, I’ve even played some ping-pong with Jim Duffy and Scott Belware; it’s been probably a decade since the last time I played it, but, surprisingly enough, I didn’t get my ass kicked too bad.  🙂
 
alright, now I’m wiped out… I’m beat up, so I’m gonna go take some rest to be able to enjoy the Summit.

Leave a comment

MVP for 2006-2007

A few days ago I got an email from Microsoft stating that I’ve received the MVP Award one more time for the 2006-2007 period. This is an honor, and I’m quite happy for it. This is the 5 year in a row I’ve received it. And now that I think about, I can remember each one of the awards, and how each one of them has been special in some way:
 
  • The 1st one: I was full-throtle on helping the Visual FoxPro community in Brazil, mostly because I knew many developers were having a real hard time using VFP due to the lack of material in Portuguese. I then got involved with writing articles, putting together a magazine, doing presentations, actively participating on forums, etc. At the time, Brazil only had 5 or 6 MVPs, and I was the first one to be awarded for Visual FoxPro. That was a BIG honor for me.
  • The 2nd one: that one was special because the nomination didn’t come from the MS Brazil; it actually came from Redmond. That meant that the folks at that Fox Team had heard about me, and were noticing my efforts in helping the community.
  • The 3rd one: at first, I got nominated again by the Fox Team at Redmond. But at that time I wasn’t doing a lot of work in VFP anymore; I was doing a lot more with .NET, even though I was still writing articles and doing presentations for the VFP developers, mostly helping them learning .NET and leveraging their knowledge acquired over the years working with VFP. When attending the MVP summit at Redmond that year, I’ve asked if I could switch from being a VFP MVP to a C# MVP, and they were cool about it. So that was good because it represented better what I was working with those days.
  • The 4th one: I wasn’t sure I was going to be awarded; I wasn’t an exclusive VFP developer anymore, and wasn’t well-known on the .NET community. Regardless, the MVP reviewers kept an eye on the articles and presentations I was doing, and decided I should be awarded again. I was really happy with that.
  • The 5th one: with the huge number of developers on the .NET community, and the big number of existent .NET MVPs, it’s getting more and more special to be awarded along with so many bright minds well-known "guru-like" MVPs out there. I’m really happy I can still be part of the group.

That’s it for now.

Leave a comment

Microsoft MVP Award for 2005-2006

This is good news: last night I’ve received an email from Microsoft saying I’ve received the Microsoft MVP Award one more time. This is the 4th year in a row I receive the award, and I’m pretty happy to know that my work with the software developers’ community is still relevant.

2 Comments