Hi Philip,
I'm working with DynamicProxy, ProxyFactory cache. I noticed I could use the following method signature in my code to create a proxy:
ProxyFactory.CreateProxy<T>( someInterceptor )
Which is very nice.. However, notice, since baseInterface is a params parameter, I don't need to pass in "null" or some fake array to satisfy the baseInterface parameter. The code ultimately looks cleaner from the callers perspective.
However, now if we take a look at ProxyFactory.Cache/IProxyCache, we find, that in order to store a proxy in ProxyFactory.Cache we have a signature of the following:
ProxyFactory.Cache.StoreProxyType(Type result, Type baseType, Type[] baseInterfaces);
Only, except, baseInterfaces here is not params, so callers are forced to satisfy baseInterfaces with either passing null or "new Type[0]".
------------------------
It would be nice if the baseInterfaces were params in IProxyCache too. This way, the API would be consistent with the rest of the DynamicProxy API. However, I'm not fully aware of the side effects this might cause, so ultimately, it's only a suggestion.
Also, I noticed, IProxyCache.Contains()/GetProxyType() have "Type[] interfaces" as a parameter name not "Type[] baseInterfaces". I sorta got confused and had to look at the source code to figure out if they were the same or not. I know it's a cherry picking issue, but it's nice to be consistent with the rest of the API.
Any thoughts?
Thanks,
Brian
----------------------------------------------
Brian Chavez
Bit Armory, Inc.
http://www.bitarmory.com
Hi Philip,
It was partly due to a misunderstanding on my part on how caching worked in LinFu.DynamicProxy.ProxyFactory. I was trying to improve proxy building performance in an ASP.NET application. Originally, I was trying to cache the types in HttpApplicaitonState using a custom caching technique.
After taking a better look at the source code, I noticed that I could simply cache 1 ProxyFactory in HttpApplicaitonState without having to roll my own proxy cache. I didn't know that ProxyFactory had its own caching strategy (which is why I was trying to implement caching). Sorry! But at least the API is a little cleaner. Also, I'm going to work with some distributed caching soon, so this little experiment might come in helpful in the future.
-Brian
----------------------------------------------
Brian Chavez
Bit Armory, Inc.
http://www.bitarmory.com
Hi Philip,
Currently, I'm working with indeXus Shared Cache:
http://www.codeplex.com/SharedCache
which has some support for Distributed and Replicated caching. We're not in production yet; in fact, we're still very much in development, but the iteration I was working on was performance related.
I'm using LinFu to help keep our application code base maintainable and so far, it's working out really well. I haven't had a problem with LinFu.DynamicProxy and seems to be pretty fast as-is. We've been working on our project for about a year now and I can't exactly let the cat out of the bag yet until we release (which should be in a few more months).
Once released, I have plans on a blog post and article on CodeProject with the source to the helping framework we built on top of LinFu that we're using for our larger project. It's really cool, I can't wait to share what we built! :P
I won't have any real-world performance numbers until it's been released and in the wild. But I'll post them once we get there.