1

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.

2
  • Remoting is obsolete - use WCF instead. Commented Sep 26, 2011 at 9:49
  • I can't use WCF because of conditions of workaround. Commented Sep 26, 2011 at 10:20

1 Answer 1

2

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.

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

Sign up to request clarification or add additional context in comments.

5 Comments

@Praetor12 (that isn't a stupid question; don't put yourself down) if I send an instance of an object, but that object can see something else, which can see something else... etc; then the entire set of reachable objects is the graph. Remoting, when it needs to serialize, uses BinaryFormatter, which will send as much as it can see.
Thanks for the fast and simple answer Marc. If remoting to do in such way - that is ugly and uneffectively. I thought It sends only parameters of calling methods or values of fields and of properties and only remoting object need to be serialized :(
@Praetor12 it all depends on exactly what is proxied vs serialized; the result of a method, for example, could be a serialized object graph, or could be a proxy; likewise the argument to a method could be a serialized graph, or could be a proxy. It is impossible to say much more without some very specific examples.
What is any other implementation? When using AppDomains, are there any other ways of passing objects other than to serialize them?
@Suncat2000 you could use shared unmanaged memory shared between two instances, but that restricts the types you can use to value-types - basically anything that would satisfy the T : unmanaged constraint

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.