These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Nhibernate 2.0 events
PostPosted: Sat Apr 05, 2008 6:44 pm 
Newbie

Joined: Sat Apr 05, 2008 6:33 pm
Posts: 16
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.html

There 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 :)


Top
 Profile  
 
 Post subject: Re: Nhibernate 2.0 events
PostPosted: Mon Apr 07, 2008 10:25 am 
Newbie

Joined: Mon Apr 07, 2008 10:21 am
Posts: 1
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.html

There 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?


Top
 Profile  
 
 Post subject: Re: Nhibernate 2.0 events
PostPosted: Tue Apr 08, 2008 3:33 pm 
Newbie

Joined: Sat Apr 05, 2008 6:33 pm
Posts: 16
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.html

There 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?


That is an interesting question. I am not really sure either when interceptors should be used and when the new event system should be used. My guess is that since the event system is global it is easier to use that to catch lifecycle events for large entity groups. I think the interceptor is added on a per entity bases or can you have global interceptors?

Btw, the new statistics system is great: http://www.codinginstinct.com/2008/04/n ... orail.html


Top
 Profile  
 
 Post subject: Re: Nhibernate 2.0 events
PostPosted: Tue Apr 08, 2008 9:46 pm 
Regular
Regular

Joined: Wed Jun 21, 2006 3:13 pm
Posts: 110
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.html

There 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.


Top
 Profile  
 
 Post subject: Interceptor vs events
PostPosted: Wed Apr 09, 2008 2:13 pm 
Newbie

Joined: Sat Apr 05, 2008 6:33 pm
Posts: 16
@benhyrman

But if the new event system is meant to completely replace the interceptor then why has the intercepor stuff been improved as well? Is there any scenario where the interceptor can only be used and vice versa for the event system?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.