BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News WAF and Caliburn: 2 WPF Application Frameworks

WAF and Caliburn: 2 WPF Application Frameworks

This item in japanese

Bookmarks

WPF Application Framework (WAF) and Caliburn are two open source frameworks offering the foundation to developers to write WPF/Silverlight applications based on the Model-View-ViewModel (MVVM) pattern using a layered architecture.

WAF uses the Model-View-ViewModel (MVVM) pattern, which is quite similar to the PresentationModel, as defined by Martin Fowler. This pattern, as used by WAF, can be described by the following UML diagram:

Model-View-ViewModel Pattern

View – this class contains all the GUI widgets, but not their state nor behavior.

IView – an interface for the View class.

ViewModel – contains the state and behavior for the GUI widgets. The reason those elements are saved here is to avoid tying the application code to the GUI interface, so the application can be easily ported to a different GUI system. The ViewModel can interact with View through its interface.

Controller – The MVVM pattern does not mention a controller but WAF contains one, having the responsibility to direct the flow of the application. If necessary, ViewModel informs the Controller on changes through events.

Model – An underlying domain class. Changes in the Model are transmitted to the View or ViewModel via events.

WAF is built with a layered architecture in mind as the one presented below:

layered-architecture.png

The framework contains basic classes/interfaces which are to be extended to fit the application, such as Controller, IView, ViewModel, Model, and also a number of file dialog/message service classes. The framework also comes with code samples for a book library, an email client, a document oriented application, and also basic support for unit tests. WAF has been submitted to CodePlex by user jbe2277, which did not decline his identity, but he seems to be a developer on the Microsoft pattern&practices Smart Client Contrib team.

Caliburn is yet another open source WPF and Silverlight framework, built around the same MVVM pattern. The project’s website mentions the following features:

  1. Extends data binding to methods, making MVVM architectures simple and intuitive.
  2. Adds pre/post execution filters and rescues to MVVM actions.
  3. Simplifies asynchronous programming through a powerful implementation of co-routines.
  4. Provides base classes supporting common UI roles such as Screen Activator, Screen Conductor, Screen Collection and Application Controller.
  5. Encourages a convention over configuration approach to architecting solutions.
  6. Supports TDD by providing a powerful data binding validation framework for WPF.
  7. Enables use of the same API for WPF and Silverlight architectures

The framework seems to be similar to WAF in many ways but it is more mature having over 100 classes/interfaces. It also comes with Silverlight and WPF samples such as a Contact Manager and a Game Library. Caliburn is backed by Blue Spire.

Rate this Article

Adoption
Style

BT