SL4, Prism4, MEF, Unity, Wcf Ria Service, EF4 o Nhib

Topics: Prism v4 - Silverlight 4
Nov 2, 2010 at 11:14 AM

I'm starting a new LOB application with Silverlight v4 and WCF Ria Services (maybe Sp1), EF4 o Nhib

The idea is to use Prism v4, that includes MVVM, MEF and Unity.

Can I use all togheter these "tecnologies": which scenario of architecture can be imagined?

Make sense to write a skeleton to build such kind of application (with tests?!?) that can be reuse? Maybe already exist as sample application?

(in Prism v4 there are a lot of sample project, but not one that includes all "tecnologies")

Thanks in advance.

Nov 2, 2010 at 1:51 PM
Edited Nov 2, 2010 at 1:53 PM

Imo choose MEF or Unity not both... I am using WPF and EF4, but will probably include WCF later for communication with WinPhone7.   Other than that yes it can be done.  Also there have been some interesting developments from MS at PDC about using Silverlight for web development.  Now they say to use Html5 and SL is for WinPhone7

Nov 2, 2010 at 4:10 PM
Edited Nov 2, 2010 at 5:26 PM


Nice to see that you are considering to use Prism 4 in your application. First of all, when you start a new application with Prism, you have to take key decisions. Therefore, I think that you can find the following documentation sections in the Prism4.chm interesting (it will be available on MSDN early the following week):

  • Chapter 2: The Prism Bootstrapper, see the Key Decisions section.
  • Chapter 3: Managing Dependencies Between Components, see the Key Decisions section.
  • Chapter 4: Modular Application Development, see the Key Decisions section.
  • Chapter 5: Implementing the MVVM pattern, see the Key Decisions section.
  • Chapter 6: Composing the User Interface, see the UI Layout Key Decisions section.

As for the Dependency Injection Container (DIC), the product team of Prism recommends you the usage of Unity or MEF. Quickstarts and Reference Implementation Applications are using them. But take into account that Prism is container-agnostic. That means that you could use the DIC of your choice. Therefore, one of your key decisions will be to choose the DIC for your application, as mentioned in this thread.

Regarding to your questions about architecture, there is a specific document about the Prism Library Architecture, so you could take a look at the following documentation section in the Prism4.chm: Prism Library Baseline Architecture

Most Quickstarts and Reference Implementation Applications include acceptance tests, so you will find in the following list some of them:

  • Commanding Quickstart
  • EventAggregation Quickstart
  • Modularity Quickstart
  • MVVM Quickstart
  • Navigation Quickstart
  • UIComposition Quickstart
  • Stock Trader Reference Implementation Application

If you are looking for a more complex scenario that ties together all technologies provided in Prism, you could check the Stock Trader RI. Some of the Design Concepts, Technologies and Patterns implemented in this application are:

  1. Managed Extensibility Framework (MEF) as the dependency injection container.
  2. Modularity and user interface (UI) composition through custom attributes.
  3. Model-View-ViewModel pattern (MVVM).
  4. Region-based navigation.
  5. Modularity.
  6. UI Composition.
  7. More...

For further information about this Reference Implementation, you could check the following documentation section in the Prism4.chm: Stock Trader Reference Implementation

On the other hand, about the Silverlight role, which is mentioned in Bob Muglias's interview during PDC, he posted some clarifications  as well as Somasegar:

Hope this helps.

Fernando Antivero