NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

ObjRef Class

Defines the marshaled object reference class.

An ObjRef is a serializable representation of an object used to transfer an object reference across an AppDomain boundary. The act of creating an ObjRef for an object is called marshaling. The ObjRef can be transferred via a channel into another AppDomain (possibly on another process or machine). Once in the other AppDomain, the ObjRef must be parsed to create a Proxy for the Object, generally connected to the real Object. This operation is called unmarshaling. ObjRefs have enough information that describes the Type/ class of the object being marshaled (like the class hierarchy), something that will uniquely identify the specific object instance (the URI) and how to reach the remoting-subdivision where the object lives (communication related information).

An important notion to be aware of about marshaling are the semantics of Marshal-by-Value versus Marshal-by-Reference. When a reference to an Object is converted to an ObjRef such that the Proxy created after unmarshaling talks to the original object for most method calls via a proxy, this is called Marshal-by-Reference. However, there are objects whose state does not change in any interesting way once initialized. For such objects, it makes sense to send over the entire state of the Object in the ObjRef and then create a local object that is a clone of the remote one within the remoting-boundary of the client. This is called Marshal-by-Value.

Object
   ObjRef

[Visual Basic]
Public Class ObjRef
   Implements IObjectReference
[C#]
public class ObjRef : IObjectReference
[C++]
public __gc class ObjRef : public IObjectReference
[JScript]
public class ObjRef implements IObjectReference

Remarks

[To be supplied.]

Requirements

Namespace: System.Runtime.Remoting

Assembly: mscorlib.dll

See Also

ObjRef Members | System.Runtime.Remoting Namespace