NHibernate:侦听器和侦听器之间的区别 [英] NHibernate: difference between Interceptor and Listener

查看:95
本文介绍了NHibernate:侦听器和侦听器之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

主要查看NHibernate I中所有创建/更新列的可能性(

Looking at all the possibilites of creation / update columns in NHibernate I mostly (Stackoverflow question, Ayende Rahien) see solutions with Listeners.

在我公司对此进行编程的程序员使用拦截器来实现相同的目的.

The programmer who was programming this in my company used an Interceptor to achieve the same thing.

这两种解决方案之间有区别吗? (是其中之一已过时,是其中之一是首选,利弊是什么?)

Is there any difference between those two solutions? (Is one of them obsolete, is one of them preferred and what are the advantages and / or disadvantages)

推荐答案

拦截器是旧的方法,事件侦听器是新的,并且服务器具有相同的用途.因此,在一个新项目中,建议使用事件侦听器.您需要连接到新的 NHibernate事件系统.

Interceptors are the the old way, event-listeners are newer and server the same purpose. So in a new project, event-listeners are recommended. You hook up to the new NHibernate event system.

编辑:正如Rashack在他的评论中提到的那样,有些操作只能使用拦截器来完成.

As Rashack mentions in his comment, there are some operations that can only be done using the interceptor.

这篇关于NHibernate:侦听器和侦听器之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆