Dude where are my WorkItems?

Jul 7, 2008 at 7:16 AM
Hi guys,

coming with background from CAB I miss the concept of WorkItems.Does PRISM realy have only modules?
What about the IContainerFacade? Is this intend to create custom "WorkItems".

Guidance needed!

Jul 7, 2008 at 7:36 PM
I, as well, have my background in CAB.  I'm just beginning to work with Composite WPF (CompWPF), but here's what I've found...

The WorkItem isn't gone, it has just been reorganized and improved to leverage WPF.  First, for Dependency Injection, Comp WPF uses any DI container you want.  The Stock Trader RI uses P&P's Unity Container.

Now let's break down the WorkItem collections:

Commands - Replaced with WPF Commands.  See the Commanding Quick Start.
EventTopics - See the IEventAggregator Service interface in the Events Quick Start.
Items - Again replace with DI Container of your choice.
Services - Service dependencies are resolved the DI Container similar to CAB.
Smart Parts - Lots of options here - Any WPF User control can be a smart part or you can simply display a model with an associated DataTemplate (an approach I favor).  Separated presentation parts are again wired through the DI container.
State - Personally I never used this much in CAB, but you can resolve global state through the DI container if you wish.
UIExtensionSites - I personally haven't explored this much.  But with WPF's flexiblity a module can just add new items to a menu/toolbar without extra functionality.  It could just be a Comp WPF region. 
WorkItems - You can create you own hierarcy of containers, but Comp WPF seems to favor simply one container.  What's more important is to segment you business logic.  See WorkItem controller below.
Workspaces - Comp WPF uses regions and Region Manager service.  You can name regions in your XAML with an attached property.

When CAB was used in SCSF, the SCSF team began separate WorkItem level business logic into a separate controller (i.e. ControlledWorkItem<T>).  You can still maintain use case business logic in a controller.  The OrdersController in the StockTrader RI is an example of a controller.

Hope this helps.  Suffice it to say, our organization is quite excited about Composite WPF.  We're finding tasks that would take days with CAB are now taking just hours with Composite WPF.

Jul 8, 2008 at 4:22 PM
Jim is absolutely right. I would also like to add that we're currently working on a document that provides the conceptual mapping between the things in CAB and Composite WPF. When it's done, we'll put it up on codeplex.