Posts tagged as:

NHibernate

Adding Audit Capabilities to NHibernate Entities

February 16, 2009

NHibernate 2.0 brings many new features, including a new event / listener system that can be used for many kinds of cross-cutting concerns. One the capabilities is being able to register a listener that can automatically update fields on an entity for you as it is saved. Many business applications require that we track who last modified an entity, or when it was created etc. This new model makes it quite easy to do.

Read the full article →

Implementing Dirty Flags When Using DataBinding With NHibernate

February 12, 2009

A common feature of any reasonably well designed application is to notify a user if they are about to cancel or lose pending changes. This becomes more difficult if you are using databinding, and even more so if you are binding directly to your domain objects. This post illustrates an easy way to implement databinding with dirty flags while promoting loose coupling between your domain objects and your UI.

Read the full article →

WPF Databinding with NHibernate Collections

January 24, 2009

WPF and Silverlight offer powerful databinding features. To take advantage of this, your entities are required to implement the INotifyPropertyChanged and INotifyCollectionChanged interfaces. It sounds pretty easy, but there is a catch. By default the collections that NHibernate uses are IDictionary, IList and ISet, none of which implement the INotifyCollectionChanged interface which is needed for databinding to work. There is a way around this limitation.

Read the full article →