matnick wrote:
torkelo wrote:
Hi,
I have been experimenting with the new event system in NHibernate 2.0 and I found it very nice. I even wrote a piece on how you can use it:
http://www.codinginstinct.com/2008/04/n ... eners.htmlThere is no documentation for this feature yet (that I could find) so I can't be sure that I use the intended approach but it seems to work pretty well :)
That is nice, I guess there are a lot of new useful features in NHibernate 2.0. Cant the IInterceptor interface handle the same scenarios that the event system is meant for? When should you use the IInterceptor and when should you use the event system?
torkelo, excellent article. Thanks!
matnick, my feeling is that you'd want to stop using IInterceptor altogether. If I remember correctly, you can only have a single interceptor (or you create a facade interceptor that chains the rest of them together). whereas the event system easily allows multiple events. I'm sure it's not official, but I'm treating the interceptor method as deprecated, in my mind at least.