PRISM and Smart Clients

Topics: Prism v2 - WPF 4, Prism v4 - Silverlight 4, Prism v4 - WPF 4
Jun 7, 2010 at 11:31 PM

Hello everybody,

I have just started a from-the-ground-up rewrite of my project, genesissmartclient.codeplex.com (The Genesis Smart Client Framework) using PRISM and Composite Application techniques.

Currently I have a standard PRISM setup with a Shell, Infrastructure Library and one Module. This has been split over WPF and Silverlight using multi-target development aided by the PRISM Project Linker. I recommend anybody who is looking to learn the basic concepts of PRISM to go and download changeset 46607 of my project (http://genesissmartclient.codeplex.com/releases/view/46518).

As I have mentioned, I have just started a rewrite and I am basing alot (currently all) of the functionality of the modularization that I used to do myself on PRISM. This means that developers who are familiar with the Composite Application Library (PRISM) and Inversion of Control containers should have little trouble easing into the Smart Client arena. I know that PRISM almost acts like a Smart Client by having automatic module discovery and updating built in, but it still lacks a management implementation and some other features.

I am going to be elaborating my project over the next month to include a full management system to maintain user security and access, module registration and delivery and some other things. You can also read my article on the basic requirements for a PRISM multi-target shell application here http://www.codeproject.com/KB/smart/GSCF2UXP1.aspx.

Alot of the application is based on the multi-target techniques that the Microsoft Patterns and Practices team have applied to the StockTraderRI application, in fact I have copied their Behaviors and some other base classes, and adapted some others. I have changed the mechanism used to display the Main View to disconnect it from the actual Shell application. The Shell application simply loads and executes the bootstrapper, which in turn loads and starts each module. I have adapted a module to contain the Main View so that I can reuse the Shell application to host any form design that I might envision.

To explain what I mean: I sometimes want a User Interface that contains a Ribbon with a Docking control, and other times I want a simple menu/toolbar with a Tab control. By following PRISM coding recommendations I would have had to create two Shell applications containing each unique Main View. With my seperation of interest between the Shell and the actual Main View, I simply ship a different Module to the client.

Please comment on any of the system components as I would love to improve them.

Jul 23, 2010 at 7:33 PM

Hi,

Based on our understating, you could use three techniques in that case depending on your specific scenario. If you have a different layouts, you might use multiple shells, each one with its specific layout. Another option to have different layouts is to have one shell containing one main region, and switch the view displayed on that region. While if the only difference in the UI is a view(Ribbon or Menu view), you could use UI Composition for displaying different views depending on some logic.

For more information about Multiple Shells, you could take a look at the following links:

For more information about using one shell containing one main region, you could check at the following links:

Fore more information about UI Composition, you could take a look at the following links:

Please let me know if this helps.

Fernando Antivero
http://blogs.southworks.net/fantivero