in a comparison of OR-Mappers, I read that Telerik OpenAccess ORM is enhancing the code.
What are the benefits, and how does this work?
Kind Regards,
Stephan
1 Answer, 1 is accepted
0
Jan Blessenohl
Telerik team
answered on 08 Oct 2009, 07:45 AM
Hi Steven K,
Assembly enhancement is an often used technique these days. Several projects like PostSharp are using it.
The enhancement process can be started as part of the product build inside Visual Studio or with our command line tool venhance.exe. The enhancement step reads the compiled assembly, analyzes it's content and is writing a new assembly with the same content but plus the functionality OpenAccess needs.
Which functionality is that? For change tracking and lazy loading we need an indirection in all read and write accesses to persistent fields. That means we replace all direct field access places in the code with a function call that implements our lazy loading and change tracking. This allows to work completely without reflection which makes OpenAccess faster. The enhancer also makes sure that all read and write places are intercepted. If you use generated code you might add direct field access somewhere in your code and the ORM does not see it.
I often here as negative argument that you cannot see the generated code. That is true, but are you really looking into the tons of generated code from other tools? And if you really want to see it you still have the reflector.