As Krzysztof has mentioned the cache has to be per instance. I mentioned earlier just using a dictionary in the proxy because I thought it would keep the proxy neater, but having a field for each method may be better (I'm not sure how much faster it would make it). However, it means that the AbstractInvocation needs to write to each field instead of being passed a simple cache object. Clearing the cache has to know about each field for each MethodInfo, but that might not matter depending on where the clear cache method is provided. If we went with an interceptors field for each method wouldn't that mean that the code generation of the method would have to be changed to pass this field to the IInvocation, otherwise you have to use reflection to get the FieldInfo (which could be cached but complicates things more)?
On Tue, Dec 23, 2008 at 12:44 AM, Krzysztof Kozmic <[email protected]>wrote: > > Hi > > If we are to keep the cache as a field in the proxy type, we might as > well instead of creating another type (SelectionResultCache) create an > IInterceptor[] field per each cached method, simiar to the way its done > in my patch > BUT, instead of code-gening selection, pass the field by ref to the > Invocation object, along with the selector and then if the field is null > perform the selection. This adds the minimal anmount of code that should > be generated (an additional field per proxied method) while not having > the cost of dictionary lookup at runtime. > > Other than that, back to your suggestion: > Selector's cache must not be static. That is because each INSTANCE can > have different interceptors, and as such, can have different > interceptors for different methods. You'd have to keep mapping > ProxyInstance-->MethodInfo-->interceptors but then You'd keep static > reference to potentially short-lived object. > > Krzysztof > > CONFIDENTIALITY NOTICE > This message is intended exclusively for the individual or entity to which > it is addressed. This communication may contain information that is > proprietary, privileged, confidential or otherwise legally exempt from > disclosure. If you are not the named addressee, you are not authorized to > read, print, retain, copy or disseminate this message or any part of it. If > you have received this message in error, please delete all copies of this > message and notify the sender immediately by return mail or fax ATSI > S.A.(+4812) 285 36 04. > Any email attachment may contain software viruses which could damage your > own computer system. Whilst reasonable precaution has been taken to minimise > this risk, we cannot accept liability for any damage which you sustain as a > result of software viruses. You should therefore carry out your own virus > checks before opening any attachments. > > > > > -- Jonathon Rossi --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
