This is a migrated thread and some comments may be shown as answers.
Code Enhancing
1 Answer 31 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Steven K
Top achievements
Rank 1
Steven K asked on 07 Oct 2009, 05:21 PM
Hello,

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

Sort by
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.

Greetings,
Jan Blessenohl
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
General Discussions
Asked by
Steven K
Top achievements
Rank 1
Answers by
Jan Blessenohl
Telerik team
Share this question
or