| Comments

Quick, what’s the most popular thing in XAML development?  Yeah, thought so…MVVM or Model-View-ViewModel.

It’s one of the most popular subjects I hear about when people talk about developing applications with WPF and Silverlight.  However, as much as it is talked about and as much as frameworks are born every day, there isn’t a ton of just simplified ‘here’s how you do it’ information in one place.  I mean, sure there *is* information, but I have to admit I think it is a bit scattered all over.

One of the pioneers of promoting this pattern for WPF development, Josh Smith, took some time to try to solve that.  Josh has recently released a self-published book titled Advanced MVVM and is a quick and good read about the pattern.

FULL DISCLOSURE: Josh presented me with a complimentary printed copy of this book a few weeks ago.  I had already intended on purchasing it when available on Amazon Kindle and have since done so.  In the nature of ensuring I share the love and complimentary goodies, Josh allowed me to give away my printed copy to someone, which I did at a Silverlight user group meeting just last night.  I’m grateful Josh provided me with a printed copy and also grateful he encouraged me to give it as a prize.

Advanced MVVM Book CoverThe book is about 50-ish printed pages and is a quick read.  It covers creating a simple and common game, Bubble Burst, using the MVVM pattern.  The code is all WPF, but the concepts still apply to Silverlight development and Josh points out some areas where there are differences.

All of the code discussed in the book is available to download so that you can work with starting projects as you go throughout the book learning the pattern.  Josh covers all the key topics of the pattern you would expect: ViewModel, View, Commands, etc.  One of the things that Josh is good about is not being a zealot of the pattern.  He’s quick to point out that when code belongs with the View and when he thinks it doesn’t.

When doing development I always think it is a great idea to have some solid references on your shelf.  No matter where you are in your skill set, there will always be those times when you want to refer back to something you may have forgotten or perhaps get a different perspective on a specific way of doing things.  For MVVM development, I think this is one such reference.

On a side note, Josh got a lot of crap for his initial chosen method of distribution (Lulu digital, which uses a DRM PDF).  He quickly responded and offered a printable copy as well as put it on Amazon for Kindle distribution (which I bought and can read on my Kindle, my phone or my PC…note: phone and PC are in color too).  There are a multitude of ways you can get the title all of which are listed at the AdvancedMVVM.com web site which also lists a table of contents for the book.  If you are doing Silverlight or WPF development you should pick it up, read it and keep it handy.  It’s not the only opinion, of course, but it is a great presentation of the pattern relevant to the development platform that I’ve seen.


| Comments

The big news in the Silverlight developer world today is the release of Prism v2 (also called the Composite Application Guidance).  So what is this?

Prism guidance is a set of tools, samples, references and written guidance to help you more easily build modular applications.  Generally the “modular” application will feature several screens, flexible user interaction and role-based behavior.  Composite applications using these patterns are meant to be loosely coupled and contain independently evolving pieces that can work together.  So in the Prism 2 release you are provided:

  • Composite Application Library
  • Reference Implementation (Stock Trader application)
  • 9 Quick starts
  • 26 How-to’s
  • Documentation and written guidance on the UI patterns and client architectures you may face

There has been much talk about the Model-View-ViewModel (MVVM) pattern for Windows Presentation Foundation (WPF)and Silverlight development.  The Prism release adapts this model (refers to this as the presentation model to match what some other pattern documentation in the greater technology world uses) in the reference implementation of the Stock Trader application.

NOTE: The Stock Trader application is a reference implementation of the composite application guidance.  It isn’t meant to actually server real stock trading, but was inspired by those similar scenarios.

Prism 2 is an evolution from a July 2008 release that was primarily for WPF applications.  This new release brings updates and those concepts to Silverlight, including an implementation of commanding in Silverlight as well as demonstration of the use of input validation using these concepts.

For a walk through of some of the concepts and a brief discussion from the Patterns and Practices program management team, watch the latest Continuum show about Prism with Blaine Wastell.  This is a great development evolution for line-of-business application developers.  Check it out!

| Comments

My friend Joel Neubeck is doing a survey on his site about what patterns people prefer for Silverlight development.  I’m very interested in these results as well, so if you have 2 seconds, please post your vote:

Link: Poll: What separation pattern do you prefer in Silverlight development?