object traps

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John Rivers

    object traps

    hi

    does anybody know of a way to detect all accesses to an object
    including
    method or property entry and exit
    instance or static field read and write etc.

    this would be very useful during debugging but also at runtime

    imagine being able to implement an event handler for every write to a
    field etc.

    tools like speedtrace get very close to what I want

    The page you are looking for does not exist. You may have mistyped the web address or the page may have been moved.


    but I want access to that type of information from within my
    application

    john
  • Sergey Zyuzin

    #2
    Re: object traps

    On 2 ÍÁÒ, 01:38, John Rivers <firs...@btinte rnet.comwrote:
    hi
    >
    does anybody know of a way to detect all accesses to an object
    including
    method or property entry and exit
    instance or static field read and write etc.
    >
    this would be very useful during debugging but also at runtime
    >
    imagine being able to implement an event handler for every write to a
    field etc.
    >
    tools like speedtrace get very close to what I want
    >
    http://www.ipcas.com/trace-and-profi...et-tracer-and-...
    >
    but I want access to that type of information from within my
    application
    >
    john
    Hi John,

    I think what you describe can be solved with Aspect Oriented
    Programming. There are some sorts of AOP implementations for .NET,
    like Spring .Net framework for example.(http://www.springframework.net/
    doc-latest/reference/html/aop-quickstart.html )

    In .NET you can use ContextBoundObj ects to handle calls to methods and
    properties.
    Here's an article about this: http://www.codeproject.com/KB/cs/aspectintercept.aspx

    HTH,
    Sergey

    Comment

    • John Rivers

      #3
      Re: object traps

      On Mar 2, 12:41 pm, Sergey Zyuzin <forever....@gm ail.comwrote:
      On 2 ÍÁÒ, 01:38, John Rivers <firs...@btinte rnet.comwrote:
      >
      >
      >
      hi
      >
      does anybody know of a way to detect all accesses to an object
      including
      method or property entry and exit
      instance or static field read and write etc.
      >
      this would be very useful during debugging but also at runtime
      >
      imagine being able to implement an event handler for every write to a
      field etc.
      >
      tools like speedtrace get very close to what I want
      >>
      but I want access to that type of information from within my
      application
      >
      john
      >
      Hi John,
      >
      I think what you describe can be solved with Aspect Oriented
      Programming. There are some sorts of AOP implementations for .NET,
      like Spring .Net framework for example.(http://www.springframework.net/
      doc-latest/reference/html/aop-quickstart.html )
      >
      In .NET you can use ContextBoundObj ects to handle calls to methods and
      properties.
      Here's an article about this:http://www.codeproject.com/KB/cs/aspectintercept.aspx
      >
      HTH,
      Sergey

      Thanks Sergey

      that CodeProject article seems to do exactly what I need

      now I just have to understand it completely before I use it for real

      I read a bit on the Spring.net aspect oriented programming - there are
      some big ideas
      in there .. maybe too big for me *-)

      Thanks again

      John

      Comment

      Working...