Close

February 23, 2009

WPF, NHibernate and the Model-View-ViewModel design pattern (MVVM)

WPF creates a whole new range of possibilities, but you can often run into trouble when trying to combine it with NHibernate. NHibernate can’t handle ObservableCollections*, which is a quite handy feature of WPF. Furthermore, what to do with the good databinding capabilities of WPF?
Shawn Duggan provides a nice solution using the **Model-View-ViewModel **pattern here. Check out this recent article by Josh Smith for a good introduction of the MVVM design pattern (with an easy-to-follow example).

  • it is possible to work with NHibernate and ObservableCollections without the MVVM pattern, by either creating your own NHibernate collection class, or by creating a wrapper around ObservableCollection. I find the solution presented by Shawn Duggan to be the most elegant, because it combines it with the MVVM pattern.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.