Code Enhancing

Thread is closed for posting
2 posts, 0 answers
  1. Steven K
    Steven K avatar
    1 posts
    Member since:
    Oct 2009

    Posted 07 Oct 2009 Link to this post

    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
  2. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 08 Oct 2009 Link to this post

    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.
Back to Top