Do you think it would be possible to implement support for static
classes in RhinoMock using the CLR Debugging Services APIs? There is a
sample here (http://www.microsoft.com/downloads/details.aspx?familyid=38449a42-6b7a-4e28-80ce-c55645ab1310&displaylang=en)
In theory with the features of a debugger (breakpoints, changing
executing line numbers etc) is should be possible to intercept calls
to static classes.
Just curious if anyone has looked into this.
I went hunting around for an AOP system for .Net based on the debugger APIs and/or profiler APIs. You know what? There just aren't any! There are research papers and prototypes but no actual code.I'm actually a little disappointed. But then I haven't ponied up the time to help implement one yet. Frankly, I don't think I'd want to bother until the CLR provided something more suitable for runtime weaving without the overhead and inconveniences of using these APIs.Pity we can't just replace methods at runtime as with dynamic languages. Self would automatically deoptimize JITted method when a method they dependend on was changed (because its address may have changed or it may have been inlined). Pity the CLR can't do that. I wonder what the runtime impact of maintaining a linked list of dependent method tokens would be plus synchronization issues during deoptimization...Anyways here's an interesting paper for AOP based on the debugger API: http://www.iks.inf.ethz.ch/publications/files/daopnet.pdfJeff.
From: Rhino...@googlegroups.com [mailto:Rhino...@googlegroups.com] On Behalf Of Ayende Rahien
Sent: Tuesday, August 14, 2007 10:59 PM
To: Rhino...@googlegroups.com
Subject: Re: Static classes
In theory, yes, but that is going to be a lot of work.
If you can build a proof of concept for that, I would be happy to take that further.
On 8/15/07, Simon Cropp <simon...@gmail.com> wrote:
Unfortunately the free version of TypeMock does not support code coverage.
And at $279.00 US for the pro version is a lot to pay just to get code coverage.
Do you think it would be possible to implement support for static
classes in RhinoMock using the CLR Debugging Services APIs? There is a
There's a simple reason for that: people developing AOP tools usually
want their tools to be usable to create real software. If you use the
profiling or debugging APIs, you can forget that - it's way too slow
and it disables the use of "real" debuggers/profilers. That's why AOP
tool developers usually go for either compilers, IL rewriters, or
dynamic proxies.
Of course, sometimes it would be handy to have an AOP tool based on
the profiling API for development (e.g. for unit testing or special
debugging). But the profiling API is very hard to use, it's incredibly
easy to do something the wrong way (much easier than with
System.Reflection.Emit...), and it's quite hard to debug. I know
because I wrote a prototype... (That was back in 1.1, and it doesn't
work with 2.0 any longer.) It's certainly easier to refactor you code
so that it becomes mockable with RhinoMocks.
Fabian
Jeff.
-----Original Message-----
From: Rhino...@googlegroups.com [mailto:Rhino...@googlegroups.com]
On Behalf Of Fabian Schmied
Sent: Wednesday, August 15, 2007 2:13 AM
To: Rhino...@googlegroups.com
Subject: Re: Static classes
Jeff.
________________________________
> profiling API for development ( e.g. for unit testing or special