This library or framework provides guidance for developing Enterprise Level applications for WPF and Silverlight, which encourages a loosely coupled, easily testable, modular structured approach with a few good use of design patterns.
On a high level, this is my dissection of Prism’s main components:
- Modular structure by building controls into modules, and being able to plug-and-play these modules into a main application shell from a bootstrapper.
- Wide use of Dependency Injection and Inversion of Control with the Unity Application Block to decouple your dependencies and to provide for a flexible and easily testable interface for these dependencies. (see Martin Fowler’s paper on DI and IoC)
- Uses Command Pattern with specially created Command classes for developers to use for decoupling communications between presentation model and view. Prism also provides a means to implement Commanding in Silverlight 2 which is missing at the moment.
- Event Aggregator pattern that allows for communication between modules via a publisher-subscriber mechanism.
- UI Composition can be used with any kind of GUI architectural patterns, like Model-View-Presenter or Model-View-ViewModel. Overall result you would want is to separate your view and presentation logic to achieve flexibility, easy to test and more adaptable to change.
I “stole” this diagram from MSDN website, which depicts the architecture of Prism. Hope that paints a better picture.
Prism is a very good starting point for anyone attempting to create a complex WPF/Silverlight application. I have previously worked on a rich client application that uses MVP pattern with DI and IoC, and that was a great experience and fun to work on.
Personally, I feel that some of the concepts within Prism are not new, but the great thing about Prism is that it has managed to encompass all these good concepts into a unified package. More importantly, I hope Prism will help more developers out there to understand and appreciate the importance and value of well-designed applications.
|Share this post:|