left-icon

Prism 4 Succinctly®
by Eric Stitt

Previous
Chapter

of
A
A
A

CHAPTER 1

What is Microsoft Prism 4?

What is Microsoft Prism 4?


Application Architecture:

When most developers see the words, "Application Architecture", they either cringe or their eyes light up with anticipation. This love / hate relationship is due to the complexities involved when designing well architected solutions.

As developers we tend see a broad range of applications ranging from well designed architectures to solutions that seem to be patched together with no regards to good programming practices whatsoever. In a lot of cases we're stuck with the current architecture because that's what was designed before we even came into the picture. The arguments for refactoring these projects are strong, but not always practical.    

We are going to talk about cases where we can refractor or build solutions from scratch. That's where application architecture comes into play. Most developers find the time to read at least one book on this subject and if you are interested in Prism 4, my assumption is that you are aware of the principles and design patterns that are used to define a well architected solution. So, where does Prism 4 fit into this equation?

Microsoft Prism 4:

Microsoft Prism 4 is a framework designed by the Patterns and Practices team at Microsoft. It is designed to serve as a template to help developers build well architected solutions. Its designed to be used with Extensible Application Markup Language (XAML) solutions that depend on the .NET framework. These solution types include Microsoft WPF, Silverlight and Windows Phone 7 or 8 at this time. The Prism 4 framework has a library for each of these three solution types.

Note: In this book we are going to use WPF. WPF is the most feature rich of the three libraries with Silverlight and Phone 7 or 8 exposing less features respectively

So, Why Use Prism 4?

Microsoft designed Prism 4 to be used with enterprise solutions that use WPF, Silverlight or Windows Phone.

After using Prism 4 in numerous solutions, I tend to take a broader view. Why use Prism 4 in just enterprise solutions? If Prism 4's goal is to promote good programming practices why relegate it to only large enterprise wide solutions? How often has a quote, "Simple project", grown into a massive project in your experience? How often has it been necessary to deal with short comings in these projects when it was necessary to modify or add features?

If Prism 4 promotes good programming practices with enterprise solutions, why should we relegate smaller projects to anything but the same good programming practices?

I wish that I could tell you that Prism 4 is the cure-all for developing well architected XAML based solutions, but alas, that's not the case. Prism 4 will not automatically enforce good programming practices, it's necessary for us as developers to understand DI, OOP, SOLID, DRY and other good practices to effectively use Prism 4. What you will find, is that as you use Prism 4, you'll start to see how it can be used to reduce the amount of work needed to produce well architected solutions.

In this book I'll explain some of the best practices for creating well architected solutions and we'll then correlate how Prism 4 allows us to implement each practice.

Microsoft Prism 4 Features:

Prism 4 is actually composed of a number of features that in most cases can be used independently or with other features of the framework. You can for instance, use Dependency Injection (DI), and exclude all of the other Prism 4 features. But Prism 4 is most effective when all of its features are used in conjunction with one another.

Here is a list of Prism 4 Features:

  • Bootstrapper Class
  • Dependency Injection Container (Unity, Managed Extensibility Framework (MEF) etc.).
  • Shell Form.
  • Regions
  • Modules
  • Navigation
  • Commanding
  • Event Aggregation.

Other Patterns and Applications that will be used:

  • The Model View - View Model (MVVM) design pattern.
  • The NUnit (Unit Test Application).

The companion demo solutions for this book will use most of the features in this list to create 2 simple Prism 4 solutions. The Hello World solution will walk you through building a barebones  WPF / Prism 4 solution.  The Virtual Calculator solution will work with a more complex solution that is used to add and subtract two numbers. We'll use these two solutions to show Prism 4 integration with WPF solutions.

So, What's Next?

Prism 4 is a Microsoft framework that is designed to help developers create well architected XAML based solutions. It works with WPF, Silverlight and Windows Phone 7 or 8. It has a number of features that can be used alone or in conjunction with other Prism 4 features. It was designed by Microsoft's Patterns and Practices team http://msdn.microsoft.com/en-us/library/ff921345.aspx.

Any one of Prism 4's features is a strong motivation to use the framework, as we progress in this book I show you why and how to combine these features to create reliable XAML based solutions.

Scroll To Top
Disclaimer
DISCLAIMER: Web reader is currently in beta. Please report any issues through our support system. PDF and Kindle format files are also available for download.

Previous

Next



You are one step away from downloading ebooks from the Succinctly® series premier collection!
A confirmation has been sent to your email address. Please check and confirm your email subscription to complete the download.