.NET & Funky Fresh



  • <script type="text/javascript" src="http://ws.amazon.com/widgets/q?ServiceVersion=20070822&amp;MarketPlace=US&amp;ID=V20070822/US/bluspiconinc-20/8001/8b68bf4b-6724-40e7-99a5-a6decf6d8648"> </script>
Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
Introducing 'Caliburn': An MVC/MVP WPF Framework

Caliburn is a WPF framework geared towards the creation of testable, maintainable and extensible client applications.  It has strong support for MVC/MVP as well as many other features useful in the creation of a modern Windows application.  I started building an early version of this framework in the first quarter of last year for use on a WPF LOB my company was developing for a major state institution.  The framework turned out to be a boon for painlessly creating testable WPF applications.  A month or so ago I decided that the framework needed to be rebuilt in order to improve its design and to add a number of additional features; and to get it into a form that was acceptable for sharing with the larger .NET community.

In the process of building the new version, I spent some time studying other similar frameworks, which I had not done prior to building the original version.  I was pleasantly surprised to find out that several of my ideas were similar to the way the Cocoa framework functions.  I also spent some time looking at CAB and Acropolis and reading a variety of articles/blogs on related subjects.  It was my desire to build something that enables all of the above mentioned functionality but with a simpler usage story; one that feels like WPF and didn't force the use of special base classes, interfaces or custom property implementations.

On that note, you can find the full source code available for download under the MIT License at http://bluespire.com/svn/Caliburn/trunk/.  I hope you will download it and send me some feedback.  The current version still needs work, but I think you'll get the idea by playing around with the sample a bit.  I'm going to be spending several blog posts introducing and explaining the main features of the framework and I hope you'll stick with me and provide me with constructive criticism along the way.

Next week I have an exciting opportunity to sit down with Glenn Block, the p&p team and other WPF gurus to discuss the future of a similar framework that Microsoft is building.  Releasing this code gives me a great way to tangibly express to the p&p guys some of the things I have been thinking about and the techniques I have found useful in building WPF applications.  It is my desire that the p&p team 'steal' as many of the ideas in this framework as they need and that the readers of this blog give me as much feedback as possible as to whether the techniques contained therein are beneficial to anyone else besides me.

Below is a loose listing of the framework's features.  I will be going into detail as to how to use each of these features in future posts:

  • Loose messaging between WPF UI and POCO classes:
    • Use any class as a Presenter/Controller
    • Use any control/event/gesture to send messages to a Presenter.
    • Messages can carry data bound from WPF controls to be used as method parameters on a Presenter.
    • The return value of a Presenter's action can be bound back to the UI.
    • Presenter Actions can be automatically run asynchronously.
    • Presenter Actions can leverage automatic exception handling.
    • Presenter Actions can bubble up to parent presenters if actions are not handled.
  • Loose event pub/sub:
    • Use attributes or a traditional API to register publishers and subscribers.
    • Events can bubble, tunnel or move directly in the even hierarchy.
    • Subscribers can run handlers asynchronously or a publisher can specify all subscribers to run asynchronously.
    • Use any control/event/gesture to raise application events.  Use databinding to pass 'args' along.
  • Platform Abstractions
    • Interface based versions of MessageBox, OpenFileDialog and SaveFileDialog
    • more abstractions to come...
  • Markup Extensions
    • Extensions to make all the above easier to declare in Xaml
    • ResolveExtension for using the IoC container in Xaml
  • Static Gateway
    • All services are accessible through a configurable static gateway.
  • Testable
    • All framework services are interface based.
    • Stubs/Fakes and TestConfiguration provided for all services.
  • PresenterHost
    • Used to host a presenter in markup with runtime view selection.
    • Supports animated transitions between views over a presenter.
  • Module Based Architecture
    • Build your application as pluggable modules.
  • Shell Extension Mechanism
    • The shell can easily declare extension points.
    • Modules can extend the shell through a simple API.
  • Shell State Mechanism
    • The shell can track the state of various UI elements so they can be persisted across application loads.
    • Not limited to Window Size/Position.
    • Track module state across loads.
  • IoC/DI
    • Use Windsor
    • Use Spring.net
    • Use StructureMap (adapter is not quite complete)

NEXT POST - Caliburn: Action Messages

Posted 01-07-2008 10:39 AM by Rob Eisenberg


About The CodeBetter.Com Blog Network
CodeBetter.Com FAQ

Our Mission

Advertisers should contact Brendan

Google Reader or Homepage

del.icio.us CodeBetter.com Latest Items
Add to My Yahoo!
Subscribe with Bloglines
Subscribe in NewsGator Online
Subscribe with myFeedster
Add to My AOL
Furl CodeBetter.com Latest Items
Subscribe in Rojo

Member Projects
DimeCasts.Net - Derik Whittaker

Friends of Devlicio.us
Red-Gate Tools For SQL and .NET


SmartInspect .NET Logging
NGEDIT: ViEmu and Codekana
NHibernate Profiler
Balsamiq Mockups
JetBrains - ReSharper
Web Sequence Diagrams
Ducksboard<-- NEW Friend!


Site Copyright © 2007 CodeBetter.Com
Content Copyright Individual Bloggers


Community Server (Commercial Edition)