Welcome Guest, you are in: Login

Castle Project

RSS RSS

Navigation (Tools)





Search the wiki
»

PoweredBy

Castle DynamicProxy

RSS
Modified on 2011/07/09 01:26 by Krzysztof Ko┼║mic Categorized as DynamicProxy

Introduction

Castle DynamicProxy Logo

Castle DynamicProxy Logo

DynamicProxy generates proxies for your objects that you can use to transparently add or alter behavior to them, provide pre/post processing and many other things. Castle Windsor uses proxies to enable its interception capabilities, or for Typed Factories. NHibernate uses it to provide lazy loading capabilities. Moq and Rhino Mocks both use it to provide their mocking capabilities. These are just a few better known and popular usages of the framework.


Image
Where is Castle.DynamicProxy.dll?

DynamicProxy used to live in its own assembly. As part of changes in version 2.5 it was merged into Castle.Core.dll and that's where you'll find it.



Image
Use of a single ProxyGenerator's instance

If you have a long running process (web site, windows service, etc.) and you have to create many dynamic proxies, you should make sure to reuse the same ProxyGenerator instance. If not, be aware that you will then bypass the caching mechanism. Side effects are high CPU usage and constant increase in memory consumption



See also

ScrewTurn Wiki version 3.0.4.560. Some of the icons created by FamFamFam.