Search code examples
c#castle-dynamicproxylinfu

castle dynamic proxy creation


I am implementing a design where my layer would sit between client and server, and whatever objects i get from server, i would wrap it in a transparent proxy and give to the client, that way i can keep a track of what changed in the object, so when saving it back, i would only send changed information.

I looked at castle dynamic proxy, linfu, although they can generate a proxy type, but they cant take existing objects and wrap them instead.

Wondering if its possible to do with these frameworks, or if there any other frameworks that enable this...


Solution

  • Castle Dynamic Proxy 3.x or later can do that, although you have to keep in mind that it can only intercept virtual methods so it's not a perfect abstraction.