有关.NET远程处理和序列化问题 [英] Question about .NET remoting and serializing

查看:134
本文介绍了有关.NET远程处理和序列化问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个接口(我们将其命名为OuterInt)和类(OuterClass),其实现它。接口OuterInt由其他交互方法(InnerInt1,InnerInt2等),并有一些类(InnerClass1,InnerClass2等)实现这些内部接口。 OuterClass是由应用服务器端暴露通过.NET远程(RemotingServices.Marshal(_OuterClass,myOuterInt);) 我的问题是将内部类被序列化的远程处理的进程或不与应用应客户端知道这些类(例如有装配这些类参考)?我希望,我描述了我的问题明确,如果不是 - 问我的意见

I have a interface (let name it OuterInt) and a class (OuterClass) that implemented It. Interface OuterInt consists of the other intefaces (InnerInt1, InnerInt2 and etc.) And there are some classes (InnerClass1, InnerClass2 and etc.) that implement these inner interfaces. OuterClass is exposed by server-side of application by .NET remoting (RemotingServices.Marshal(_OuterClass, "myOuterInt");) My question is will inner classes be serialized in the process of remoting or not and should client-side of application knows about those classes (for example to have reference of assembly with these classes)? I hope that I described my question explicitly, if not - ask me in comments.

推荐答案

远程(也就是,因为俄德指出,pretty的多代precated)创建远程钩到的对象;不是API(接口)。因此,它的确会需要有在两端具有相同的dll(包含具体类型而远程的)。无论是序列化VS代理取决于是否从 MarshalByRefObject的继承。但通常情况下:如果是对象图中的一个的结束,那么它必须是可创建的另一

Remoting (which is, as Oded notes, pretty much deprecated) creates a remote hook to the object; not the API (the interface). As such, it will indeed be necessary to have the same dll (containing the concrete type being remoted) at both ends. Whether it is serialized vs proxied depends on whether it inherits from MarshalByRefObject. But typically: if it is in the object graph at one end, then it needs to be creatable at the other.

如果可能的话,preFER实际上的其他实施应用于远程处理,海事组织。

If possible, prefer virtually any other implementation to remoting, IMO.

这篇关于有关.NET远程处理和序列化问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆