Can I replace the Activator.CreateInstance () call in NHibernate?

Is there a way to replace the Activator.CreateInstance () call used inside NHibernate 2.0.1GA to create objects? Ideally, I would like to replace it with StructureMap.ObjectFactory.GetInstance ().

+1
source share
3 answers

You cannot easily do this with constructor injection. NHibernate internal elements may need to create a proxy object inherited from your domain class using the Lazy boot code, etc. Therefore, as far as I know, there is no easy way to override the design of your object.

, NHibernate , , , setterter. . Windsor DI, StructureMap, - StructureMap - " (BuildUp)".

: , , , , , !

+4

Fabio Maulo ( NHibernate), . NHibernate 2.1, , 2.0.1GA, IProxyFactoryFactory.

+2

setterinjetion, IInterceptor onload Objectfactory.BuildUp. , , .

, IBytecodeProvider ReflectionOptimizer. , !

. 99,9% . , 0,01% , . , , goto.

+1

All Articles