-->
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.  [ 3 posts ] 
Author Message
 Post subject: Interceptor too coarse-grained?
PostPosted: Sun Oct 09, 2005 2:13 pm 
Beginner
Beginner

Joined: Wed Oct 05, 2005 2:08 pm
Posts: 23
The other day it occurred to me while I was browsing the API that the interceptor interface could have been implemented as a series of events on the Session/SessionFactory. Events were added to C# to help avoid the problem of coarse-grained interfaces. For instance, if I only want to listen to the OnLoad message I must implement handlers for several other events. This means that several empty functions are called on each object I retrieve from the database. This performance impact may seem negligible to some, but it is conceivable that it may be an unacceptable cost for certain projects.

It seems that certain API differences have been introduced to make NHibernate were idiomatic of the dot net framework (Enumerable vs. Iterate, etc). Might this be a worthwhile change in the future (some future version perhaps)?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 10, 2005 3:39 am 
Regular
Regular

Joined: Fri Jun 11, 2004 6:27 am
Posts: 81
Location: Yaroslavl, Russia
While there could be architecture-related reasons to switch from IInterceptor to .NET events, it's completely pointless to think about performance here. Call of an empty method costs nearly nothing. At the same time, call via a delegate is a bit slower than direct call of an interface's method. Most likely the performance gain of not calling empty methods will be less than the loss from using delegates.

_________________
Best,
Andrew Mayorov // BYTE-force


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 10, 2005 9:40 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
NHibernate 1.0 is/will be the port of Hibernate 2.1 which don't use events.

We will think about adding .NET-specific/new features after its release.

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.