Overriding non-virtual methods using IL and Reflection.Emit

R

rfuller987

Is it possible to override non-virtual methods using Reflection.Emit.
I'm creating dynamic proxy classes at runtime and I want to be able to
proxy all public methods on an object, regardless of whether the object
author happened to mark them as virtual or not. Is this possible?

-rfuller987
(e-mail address removed)
 
R

rfuller987

That's a real problem. That makes real aspect oriented programming in
..net impossible.
 
G

Greg Young

Well I think you picked the right person to talk to. I have some experience
in the area :)

There are other ways of implementing AOP than the dynamic proxy ...

There are also numerous AOP frameworks with this virtual limitation .. see
CastleProject, nAspect, spring .net

People have also looked at such operations as using the profiling API to
instrument IL just before JIT (this is being frowned on a bit).Personally I
at this point am leaning towards a "link" time IL based weave ...

If you happen to be in the southern US I will be speaking on this subject in
New Orleans the 17th.

Cheers,

Greg Young
MVP - C#
http://codebetter.com/blogs/gregyoung
 
R

rfuller987

Do you have any more information on this 'link' time IL based weave.
Sounds promising, although I don't think I have the expertise to
implement it myself.

How does .net remoting work? Doesn't it manage to proxy any
MarshalByRef object regardless of the object's functions being marked
as virtual?

-rfuller
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top