Question

I have used NHibernbate in few projects and now learned about few more ORMs also. I understand that, NHibernate binds Class to Datalayer dynamically during runtime using the mapping file.

My Question is , how this late binding is done ? I mean, which Methodology is used, 'Reflection' or 'DynamicMethod' ?

In case, if it uses Reflection, Is there any ORM which uses DynamicMethod? and provides better performance ?

Was it helpful?

Solution

As of NHibernate 2.1, the proxy factory is pluggable. Here are some proxy providers supported:

  • Castle.DynamicProxy
  • LinFu
  • Spring.NET

So proxying will be actually out of NHibernate's responsibility, and the answer to this question really depends on the selected proxy factory.

OTHER TIPS

NHibernate uses Castle.DynamicProxy, which under the hood uses DynamicMethods.

Exactly how an ORM instantiates entities is not a good way to assess its overall performance.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top