2

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 ?

svick
  • 236,525
  • 50
  • 385
  • 514
Palani
  • 8,962
  • 11
  • 53
  • 62

3 Answers3

3

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.

Mauricio Scheffer
  • 98,863
  • 23
  • 192
  • 275
2

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

jonnii
  • 28,019
  • 8
  • 80
  • 108
0

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

James L
  • 16,456
  • 10
  • 53
  • 70