Saturday, July 19, 2008

Caliburn or Prism

I was using Caliburn framework on a pet project of mine for the last couple of weeks. At some point of time, when I merged my custom made styles, application did not open views anymore, complaining something is wrong with my styles. I spent a lot of time to figure out what is wrong, but found nothing, except if I do NOT use custom styles everything is working fine (Maybe that IS a proof of my styles having some error!).

So, I decided to port the application to Prism (now called Composite WPF). How smooth was the port procedure, you might ask? Caliburn and Prism are both Composite frameworks for WPF, how different can they be? Well....let's say they solve the same problem in two different ways!

With Caliburn you can use Windsor, Structure Map or Sprint.NET as your IoC container, but Prism uses Unity, the IoC container provided by Microsoft. There is a spike in Prism sources that shows how to implement other containers like Windsor, but the code is based on some earlier drop, not the final release.

Well, There is more :

  • With Caliburn you could benefit auto-wiring of method calls on Presenters (with Messages), which is lacking in Prims. In Prims you should either use Commands / Event Aggregation, or Observer pattern to inform the presenter that something is triggered on the view.

  • With Caliburn you have Transitions at your disposal, to switch between Views in a cool way.

  • Caliburn provides more functionality out of the box, e.g. State Management, Async Actions, etc.
On the other hand, Prism has full documentation, lots of QuickStarts and Reference Implementations projects, so you can learn much faster.

I should admit though, that I've just started using Prims. Apart from the fact that it is coupled with Unity for now (the Team says it won't be in the future), It looks promising.
Submit this story to DotNetKicks Shout it

1 comment:

wilzad said...

Can u post a blog for teaching us how to use prism with mvvm