linfu

Duck typing / dynamic proxies on existing instances of objects

拟墨画扇 提交于 2020-04-11 07:43:14
问题 I have an object handed into our library and passed through various processes. I need to attach some additional information to these objects as they pass through various stages and out the other end - a kind of dynamic decorator pattern, I guess, except adding additional properties rather than changing existing behaviour. I was hoping to use LinFu or Castle to create a dynamic proxy and implement an additional interface on the object to store this. Components that know about the extended

castle dynamic proxy creation

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-21 02:05:10
问题 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

castle dynamic proxy creation

拈花ヽ惹草 提交于 2019-12-03 08:01:31
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... Castle Dynamic Proxy 3.x or later can do that,