Silverlight 2 Knowledge Base

There are several frameworks used to seperate the responsibility of UI, business code and data.

  • MVC - Model-view-controller. The oldest of three.
  • MVP - Model-view-presenter. A variation of MVC in which the responsibility of updating UI has been given to the presenter.
  • MVVM - Model-view-view model. A framework that is becoming increasingly popular due to the superior data binding capabilities in WPF and Silverlight.

There are many implementations of each framework. So when evaluating a framework, it is really important to at details such as:
  1. How are view and controller conntected?
  2. How an user action from the view is sent to controller?
  3. Who is responsible for updating the view?

In the following, we show some implementations for each of them.

Edit

MVC

  • Developing a Casual Game with Silverlight 2 This example shows a classic MVC behavior. View is responsible to create the controller. Actions from view is deligated to the controller. Model notify view on changes and view is responsible for updating itself.

Edit

MVP


  • MVC# This one is similar to the previous example. It has a mini dependency injection container called TasksManager to group options together.

Edit

MVVM

(c) Li Chen 2008. ScrewTurn Wiki version 2.0.37. Some of the icons created by FamFamFam.