Prism is one of the hottest topics in Silverlight.  Here, I provide the top 10 things that I think every developer should know about Prism.

For a great write-up on Prism, I recommend:

Shawn Wildermuth’s MSDN article.


1. Prism is a collection of libraries for implementing best-practices in Silverlight

Now, Prism actually contains more than just the libraries (it also has source code, examples, quickstarts and excellent documentation), but the key thing is that Prism is a tool for creating testable/maintainable applications.

Silverlight Prism VideoSilverlight Prism Video

2. Prism is a Buffet (term coined by Shawn Wildermuth)

Prism has several different tools, and you can use any or all of them at your discretion.  It’s not a heavy-weight framework.  You can use Prism selectively.

Sparkling Client PodcastIntro to Prism Interview

3. Finding and Installing Prism is Confusing

For whatever reason, it’s hard to find and download Prism.  Actually, it’s not difficult; it’s just hard to get properly oriented.  For one thing, Microsoft sites refer to Prism as the “Composite Application Guidance”.  For another, the source appears to be on CodePlex, but it’s actually on MSDN.  So there’s a bit of a run-around before you can get up and going with Prism.  However, it’s great code and jumping through the hoops is worth it.

Sparkling Client Podcast Downloading and Building Prism Guide

4. Prism Supports Modularity

Prism is chock full of support for breaking applications down into manageable pieces.  It supports Unity for Dependency Injection and Service Location.  It also has a Module Catalog which manages the loading of .dlls and .xap files into Silverlight applications.  If you’re interested in application testability and maintainability, modularity is for you.

Silverlight Prism Video Prism Modularity Video Sparkling Client Podcast Prism Modularity Interview

5. Prism Supports Master Pages – Regions

Regions allow the visual parts of an application to be separated out and developed independently.   It’s similar to how master pages are used in ASP.NET.  If you’ve ever wanted to hand out UI tasks to different development teams, this is the tool that will make life much easier.

Silverlight Prism Video Prism Regions Video Sparkling Client Podcast Prism Regions Interview

6. Prism Supports Loosely Coupled Communication – Eventing

Once you’ve broken an application into multiple pieces, there’s always the question of how do these pieces communicate?  Especially, how do they communicate when they aren’t supposed to know about each other?  Here, Prism Eventing steps into the gap and provides communication infrastructure.

Silverlight Prism Video Prism Eventing Video Sparkling Client Podcast Prism Eventing Interview

7. Prism Supports Commanding – Help for MVVM

MVVM/Presentation Patterns are powerful patterns for building testable and scalable Silverlight applications.  Unfortunately, they require Commanding (the ability for the XAML/Interface to directly communicate with ViewModels/Presenters), and raw Silverlight 2 doesn’t have this functionality.  Prism Commanding comes to the rescue and uses attached properties to enable this scenario.

Silverlight Prism Video Prism Commanding Video Sparkling Client Podcast Prism Commanding Interview

8. Prism Supports Sharing Code Between Silverlight and WPF – Multi-Targeting

Silverlight and WPF are pretty similar.  They both use XAML, and they have similar libraries they can call.  Unfortunately, they’re different enough that you can’t add a reference from Silverlight to a WPF .dll (or vice versa).  The way to share functionality between these technologies is to share code between projects.  Enter the Project Linker.  This is an application that makes it easier to share code between Silverlight and WPF.

9. Most Silverlight Applications can Benefit from Prism

Prism isn’t the answer for all applications, of course.  There are some apps (small applications, media applications and possibly games) that Prism might not help with, but in general the patterns are widely applicable (Dependency Injection, Commanding, etc.).  Even if you don’t use Prism, the patterns in Prism are still valuable.  In fact, there are other projects such as Ninject and Caliburn that implement some of the same patterns as Prism.

Sparkling Client Podcast When to Use Prism Interview

10. Prism Helps with MVVM/MVP

Prism doesn’t directly implement either MVVM (Presentation Model) or MVP patterns.  Instead, it provides support (example: Commanding) that makes these patterns easy to implement.  See the Reference Implementation and Quickstarts for examples on how to implement these patterns using the support that Prism provides.

This post uses the free Function Icon Set.