> Ok, so what do we do about it? Following up on my idea of performing the selection in AbstractInvocation instead of via code gen (or in the interceptor): How to do the caching?
Let's say we have a type SelectionResultCache, which is effectively a wrapper around a Dictionary<MethodInfo, IInterceptor[]> with a GetInterceptors(IInvocation, IInterceptorSelector) method that performs the caching. (I'd prefer a separate class for testing and stuff.) Then I can think of two possibilities. One would be to maintain the cache in the generated type (while performing all the logic in AbstractInvoation). Ie. the proxy type would have an associated static SelectionResultCache field, whose contents is passed to the invocation's ctor together with the IInterceptorSelector. The invocation could then pass itself plus the selector to the GetInterceptors and use the result to handle the invocation. Alternatively, AbstractInvocation could have a static Dictionary<Type, SelectionResultCache> to do the caching, use the generated type as a key. This would be safe since the cache cannot be invalidated anyway until the AppDomain is unloaded (because the proxy type exists until then). I think I'd still prefer the AbstractInvocation-based approach over doing everything in codegen due to the reasons I wrote in my last mail. Jonathon? > PS > > And what is the agreed rule regarding .NET 2.0 compatibility? Do we > mandate the code to be compilable with 2.0 compiler, or only to be > compilable with 3.0 compiler using 2.0 profile? On Sept 25, Ken Egozi started the thread "dropping visual studio 2005 compatibility" on which the following was effectively decided: <quote> 1. allowing the usage of var, initialisers, lambdas etc. 2. dropping the 2005 csproj and sln files </quote> The 2005 solution file still exists, though... Regards, Fabian --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Castle Project Development List" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en -~----------~----~----~----~------~----~------~--~---
