Since the initial release of Prism in June 2008, many developers have successfully used it to build flexible, modular applications for WPF or Silverlight (and sometimes both at the same time!). We updated Prism in October last year so that it could be used with WPF 3.5 SP1 and/or Silverlight versions 2.0 or 3.0. That update (available here) was Prism version 2.1.

The recent availability of the Visual Studio 2010, .NET 4.0 and Silverlight 4.0 Release Candidates has brought us one step to closer to the next generation of WPF and Silverlight platforms. We know that many developers are really looking forward to the powerful new features in WPF 4.0 and Silverlight 4.0. But, we also know that many developers want to continue to use Prism to build composite applications on top of these new platforms and are wondering about our plans for Prism. If you’re one of those folks, then this post will answer many of your questions.

Can I use Prism for WPF/Silverlight 4.0 development?

We’re just about to start work on the next version of Prism, which we’re calling version 4.0 (because 4 is the new 7 J). We’re targeting a release around September 2010 for Prism 4.0. In the meantime, we’ve had many folks ask us whether Prism 2.1 can be used for WPF 4.0 and Silverlight 4.0 development.

To answer that we’ve started to test Prism 2.1 against WPF 4.0 and Silverlight 4.0 (using the Release candidates for each). I’m happy to say that so far, apart from a couple of very minor issues in the Reference Implementation and some of the unit tests, we’ve found no issues with using Prism 2.1 for WPF 4.0 and Silverlight 4.0 development.

Of course, once .NET 4.0 and Silverlight 4.0 are released, we will complete our testing and we’ll release an interim update of Prism (probably called Prism 2.2) which will address any issues that we do find.

OK, so what about Prism 4.0?

The patterns & practices team exists to provide guidance for building well architected solutions on the Microsoft platform. Of course, that means that as the platform evolves, our guidance will evolve too. So while Prism 2.2 will be fully tested against WPF and Silverlight 4.0, it won’t add any new capabilities or target any of their new features. For Prism 4.0, however, we plan to take full advantage of the powerful new features in .NET 4.0 and Silverlight 4.0 and provide guidance on using them to build modular, flexible composite client applications.

There are more details on our current thinking for Prism 4.0 below but, as always, as we develop Prism 4.0 we’ll be following our Agile community-driven approach and actively seeking ongoing feedback. We’ll use this feedback to guide the specific details of the project. We’ll be dropping code and docs to our Prism CodePlex site every (two-week) iteration so that you can see exactly how Prism is evolving.

So what are some of the things that we’re thinking of focusing on in Prism 4.0?

We’ve been polling the community for a while now so we’re starting to get a good idea on the main things that folks would like to see in Prism 4.0. Our current thinking on four of these is described briefly below, but once we start digging into some of the details, and as we get feedback from the community in terms of relative priority & focus, our plans may change.

  • Managed Extensibility Framework (MEF) – Probably the most often-asked question that we get is "How to use Prism with MEF?" MEF, which is new in .NET 4.0 and Silverlight 4.0, simplifies the design of extensible applications and components. We in patterns and practices have long advocated the use of patterns and techniques for loosely-coupled component composition, so it’s extremely exciting to see it supported in the core .NET Framework itself!  There are some really interesting possibilities for Prism, as described here. In particular, we’ll be looking at leveraging MEF for Component Composition (for hooking up Views and ViewModels, and other types of components), for Modularity (for the discovery, download, and instantiation of functionality packaged in a module), and for UI Composition (for mapping Views to Regions).

    Although we’re looking to leverage MEF as part of the .NET 4.0 Framework, we will continue to support folks who wish to use a traditional DI containers such as Unity through IServiceLocator.  We’ll provide guidance for those who just want to use MEF, and for those who just want to use Unity (or other DI container), for component composition. We’ll also likely cover hybrid scenarios with Unity and MEF working together. For Unity, we’ll be using Unity 2.0 which is part of the imminent Enterprise Library 5.0 release. We’ll also be updating the Reference Implementation to use Enterprise Library 5.0 too.
  • Model-View-ViewModel (MVVM) – The recent growth in popularity of the MVVM pattern is also something that we’re extremely excited about. We‘ve been encouraging the use of separated presentation patterns for many, many years and it’s fantastic to see the platform and tools finally start to support these patterns directly. Of course we’ve always provided guidance on MVVM (and other separated presentation patterns) in Prism, but there is much more we can do to make these patterns easier to apply.

    So, for Prism 4.0, we’re looking to expand our current guidance and to include more re-usable code assets to support various MVVM scenarios. In particular, we’re looking to support common patterns for View/ViewModel interaction, hierarchical ViewModel composition, and ViewModel-based navigation. In addition, we’re also looking to provide more support for application-level structural patterns, layout management, the use of Ribbon/Popup/Dialog controls, and user state management.
  • Data Access & Application Services – There are powerful new data access technologies in .NET and Silverlight 4.0. WCF RIA Services, and WCF Data Services, are of particular interest to Prism application developers. There are various aspects that we could focus on here. In particular, we are looking to provide guidance on using these technologies in the context of MVVM, and on patterns for data validation and caching. This area also includes the use of other services for user preferences, authentication and authorization. This latter aspect brings in the possibility of providing guidance for role-driven (or claims-driven) applications and user experience.
  • Design-Time Support – We’ve also had many requests is for some level of design-time support for Prism. For Prism 4.0, we’re looking at providing a number of solution, project and item templates (similar to those posted here), as well as some code snippets, to make Prism easy to use within Visual Studio 2010. .NET 4.0 and Silverlight 4.0 now offer some level of binary compatibility (Yes!) so we’ll be updating our guidance on how to share code and components between WPF and Silverlight. This may also involve updates and improvements to the Project Linker tool that allows code to be linked between WPF and Silverlight projects. Another area we’re looking closely at is the use of Expression Blend. There are many cool features in Blend (in particular the Blend Behaviors Framework and SketchFlow) that we know developers would like to use during their Prism application development.

The areas outlined above represent a lot of work, so we very well may not be able to address them all in Prism 4.0 J We’re looking to you to help us to make some key decisions and to help us prioritize which aspects we should focus on first. If you’d like to get involved, make sure you visit our CodePlex site regularly. We’ll be posting updates there often.

Lastly, given the excitement at the release of the Windows Phone Developer Tools CTP at Mix 10 this week, some of you may be wondering about using Prism on Windows Phone 7 Series. We intend to support Windows Phone development in a future release of Prism. In the meantime we’ll be tracking the Windows Phone 7 Series development platform closely.

Hopefully this post has answered many (if not all) of your Prism questions. If not, please let us know!

The patterns & practices Client Team