|
From: hammett <ha...@uo...> - 2004-11-07 16:44:34
|
Hy Darrick, Thanks for the feedback.
The Castle.DynamicProxy source can be checked out from SVN repository at
https://207.234.145.146/svn/castle/trunk/Tools/DynamicProxy/
> I have spent some time playing with Aspect# over the last couple of days,
> and
> have a few things to report to HQ. I think what you have so far is great
> stuff,
> and I'm really looking forward to using this in a project some time soon!
Nice! :-)
> First, I should note that I am using the CLR 2.0 beta1 / VS 2005. That
> said,
> the Aspect# 1.x version seemed to work fine, and this version almost
> works,
> but sometimes methods that have valid pointcuts do not get overridden by
Well, I think thats the first time it has been tested against CLR 2.0.
I don't even want to install the CLR 2.0 as it will make the NCover stop
working.. :-(
> inside AspectSharp.Core.CustomProxyGenerator. CreateClassProxy(Type,
> object[], IInterceptor). For instance, in the example program that you
> provide,
> the MixinAndInterceptorExecution function works correctly, but the
> HashTableTest
> runs but get_Item is not intercepted, and using reflection I can see that
> the
> DeclaringType of get_Item is still HashTable. I spent a lot of time on
> this but
> I could not find an error in your code, and I couldn't find the source for
> Castle.
> DynamicProxy (the one I found at Apache.Avalon was quite different).
Yeah, you're right. This's broken since my major refactoring, I havent
noticed... The get_Item is being intercepted correctly by the proxy, but no
matching is found (for some reason).
I'll dig for the reason later today.
> Secondly, I found that the cache in AspectSharp.Core.Proxy.
> DefaultProxyFactory
> did not work if the aspect was operating on more than one type. I think
> the problem
> only surfaced the second time that the second class was wrapped. Making
> the
> following change and adding an apropriate AspectInstanceKey class as below
> fixed this:
Applied! Thanks
> Fourth, I have extended the method interceptor pointcut definition so that
> we can specify
> the accessibility of the method we want to intercept. The original syntax
> still works, but
> now we can also have:
>
> pointcut method(public * *)
> pointcut method(* void *(*))
> pointcut method(internal * Method.*())
Nice!
> Finally, just for fun I added this function to the AspectEngine. I think
> it has potential
> although it is nothing particularly spectacular right now, so I thought
> I'd pass it along.
> public virtual TypeToWrap WrapClass<TypeToWrap>()
> {
> return (TypeToWrap)WrapClass(typeof(TypeToWrap));
> }
> called:
> ISomeClass d = engine.WrapClass<SomeClass>();
This is nice, but depends on the CLR 2.0. In a near future we can provide
two distributions.
I'm looking forward for your patch!
--
Cheers,
hammett
http://www.digitalcraftsmen.com.br/~hammett
|