本文介绍了城堡动态代理的创建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我实现一个设计,其中我的层将客户端和服务器,以及任何物品,我从服务器获取之间坐坐,我想它包装在一个透明代理,并给到客户端,这样我可以保持什么改变轨道在对象,所以节省回来的时候,我只会发送更改的信息。

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...

推荐答案

城堡动态代理3.x或更高版本可以做到这一点,但你要记住,它只能拦截虚拟方法所以它的不是一个完美的抽象。

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.

这篇关于城堡动态代理的创建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 21:36