Wherefore art thou, “Composite Application Guidance” ?

Ok, the title is meant to be a little jokey and is with reference to both Shakespeare and to The Gaslight Anthem and that’s quite a mix to start a blog post with Smile

Quite a while ago, I made a set of videos on the PRISM framework which was also known by the earlier catchy title of “Composite Application Guidance”.

Those videos are up on Channel9 and I still get questions on them but I warn any new viewer that they were made in 2009 which was a long time ago and they were made in the context of PRISM V2 and Silverlight so might need some updating for today’s world.

PRISM is a framework for building “composite” apps which I’ll describe in my own words as an app where pieces (e.g. pieces of UI, pieces of underlying service functionality) need to come together in a loosely coupled but structured way so as to reduce coupling between dependent components. The framework is often used by developers who are building “big” applications with lots of moving parts and where those parts are perhaps being developed across organisational or geographical boundaries and so the developers need to take a highly structured architectural approach to avoid chaos.

PRISM is a big framework with a lot of concepts involved and I’ve seen customers have great success with it and I’ve also seen customers get themselves a bit tied up in knots with it before deciding that they didn’t necessarily need all that the framework had to offer.

When I structured those videos I tried to layer them such that I didn’t introduce too many things at once. I tried to build from the ‘ground up’ talking about topics like;

  1. Abstracting implementation via interface.
  2. Injecting implementation by dependency injection (using the Unity container to do so).
  3. Modularity.
  4. Commands.
  5. Loosely coupled events.

and a lot of these topics are relevant to all development and some of them are specifically relevant to client development using the XAML technologies that have been around since 2006 and have surfaced themselves in WPF, Silverlight and now surface themselves again in Windows 8 Store app development and Windows Phone 8 Store app development.

Those technologies align with some of what you’d usually look for in an “Model View ViewModel” (or MVVM) framework and developers sometimes look to PRISM as an MVVM framework and found it more than they needed because it can be used that way but, in my view, it is more than ‘just’ an MVVM framework.

I talk to a lot of developers who are building for Windows 8 and Windows Phone 8 and the topic of “MVVM” and the way in which a XAML-based application should be structured is very much an active one and especially given that some of the framework pieces in (e.g.) Windows 8 XAML based apps make MVVM perhaps a bit more challenging than it was in WPF or Silverlight (e.g. the lack of libraries like the Blend behaviours library means you might have to do more work or look to a framework to do it for you).

Prism in 2013 – for Windows 8 Store Apps

Into this landscape comes a new version of PRISM specifically targeting Windows 8 applications and with some functionality which is portable across both Windows 8 and Windows Phone 8 (hopefully, that portable functionality will grow over time).

Along with that version of PRISM comes a new reference application, the AdventureWorks Shopper app which developers can take as an example of a “correctly” structured, implemented and tested application to help with learning how to structure our own applications to line up with that best practise.

At this point, I’ve not opened up the box too deeply on this new version of PRISM but what I have done is to watch the video over on Channel9 which I can highly recommend. It starts off looking like one those “let’s just chat” videos but quite quickly turns into an exploration of the code of the reference app;

In particular, what I pulled out of the video on first watching was;

  1. Event aggregation support.
  2. ICommand implementation.
  3. Support for navigation that’s not tied into the UI views and so can be used from view model code.
  4. Lifecycle support via suspend/resume for view model code.
  5. Convention based wiring up of views to view models (with the possibility of overriding the convention).
  6. Dependency Injection with/without a container (tested with Unity but abstracted for other containers).
  7. Validation (there’s not too much in the video on this – it would be interesting to know how this works given previous XAML based validation approaches).
  8. Windows 8 settings charm integration.

and I’m sure there’s more – I’ll be spending some time digging in to both the reference application and the framework itself to see if I can pull it apart a little and drill out the constituent pieces…

Developer’s Guide to Microsoft Prism 4

Borrowing the content from Karl’s original blog post – there’s a new book on Prism available from O’Reilly or Amazon with an eBook on its way and the MSDN materials here

What’s In The Book?

Prism helps you to design and build flexible and maintainable WPF and Silverlight applications by using design patterns that support important architectural design principles, such as separation of concerns and loose coupling.

This guide will show you how to use Prism to implement the Model-View-ViewModel (MVVM) pattern in your applications, and how to use it along with commands and interaction requests to encapsulate application logic and make it testable.

It will show you how to split an application into separate functional modules that can communicate through loosely coupled events, and how to integrate those modules into the overall application.

It will show you how to dynamically construct a flexible user interface by using regions, and how to implement rich navigation across a modular application.

Enjoy Smile

UK TechDays Virtual Client Conference–Resources

At the UK TechDays online conference last week there were a number of sessions around Silverlight and Windows that I wanted to provide follow-up resources on here.

Session: Modern Windows Applications

  1. Visit Develop For Windows
  2. Download the WPF Ribbon Control and get the information on it here
  3. Download the Windows API Code Pack
  4. Read more about the Code Pack
  5. Learn about the Task Bar with WPF 4 ( and part 2 )
  6. More on the Windows 7 TaskBar
  7. More on Windows 7 Libraries
  8. Windows 7 Sensors
  9. Restart/Recovery for Applications
  10. WindowChrome – altering the non-client area of the window.
  11. Subscribe to the Windows Team blog.

Session: User Interfaces with Touch

  1. Some recent local resources on touch;
    1. Touched ( Part 1 )–Getting Touch for Free
    2. Touched ( Part 2 )–Raw Touch Events
    3. Touched ( Part 3 )–Manipulation and Gesture Support
    4. Touched ( Part 4 )-Simple Example
    5. Touched ( Part 5 )–Touch-Ready Controls
  2. Read more about WPF 4 Multi-touch and more
  3. Check out the Native Extensions for Silverlight Preview 2

Session: Silverlight Platform Overview

  1. Visit Silverlight.Net
    1. Watch videos
    2. Try the QuickStarts
    3. Checkout hands-on labs
    4. Read books
    5. Read whitepapers
  2. Watch the Silverlight Firestarter
  3. Visit Channel 9
    1. Follow Silverlight TV
    2. Subscribe to the Silverlight tag
  4. Follow Silverlight Q&A on StackOverflow.
  5. Subscribe to the Silverlight Team blog.

Session: Buffers Guide to Expression Blend

  1. Visit Expression on the web.
  2. Learn Blend via tutorials, starter kits, etc.
  3. Check out the Toolbox resources
  4. Local resources on Blend;
    1. 20 recent posts on Blend
  5. Subscribe to the Expression Blend team blog.

Session: Silverlight for Line of Business Applications

  1. Refer back to the general section on Silverlight here.

Session: Silverlight and Multi-tier Applications

  1. Silverlight Networking Videos on Channel 9
  2. Visit the RIA Services Site
  3. Visit the OData site.
  4. WCF Data Services on MSDN.
  5. Understand the WCF subset in Silverlight.
  6. Understand the security options in Silverlight for service access.
  7. and again
  8. and again
  9. and again
  10. Understand the Client/Browser HTTP stacks in Silverlight

Session: WCF RIA Services

  1. Visit the RIA Services Site
  2. RIA Services on MSDN
  3. Watch Deepesh at TechEd 2010
  4. Subscribe to Deepesh’s blog.

Session: MVVM and RIA Services

  1. Watch John’s session from PDC 2010.
  2. Read Josh’s article on MVVM.
  3. Subscribe to John’s blog.
  4. Follow the RIA Services resources from the previous session.

Session: Silverlight Apps with PRISM

  1. PRISM on CodePlex
  2. PRISM on MSDN
  3. PRISM videos on Channel 9 ( previous PRISM version )
  4. Subscribe to Karl’s Blog

Session: Premium Media Experiences with Silverlight

  1. Learn about the Silverlight Media Framework.
    1. Watch videos on Silverlight.net
  2. Learn about IIS Media Services
  3. Subscribe to David’s blog.