A context is a grouping of objects that provides mutual isolation. In general, an object is created in a particular context and any attempt to access the object from another context is mediated by the context itself. That is, attempts to:
are mediated by both the context from which the attempt is made and the context in which the object exists.
A remoting boundary exists between contexts if it is not possible to share the identity of an object directly between the contexts. For example, if the contexts exist on physically separate machines that do not share a common address space, then a remoting boundary will exist between them. There are other administrative mechanisms for creating remoting boundaries. No single context can span a remoting boundary, hence crossing a remoting boundary always implies crossing a context boundary.
The VES provides a mechanism, called the application domain, to isolate applications running in the same operating system process from one another. Types loaded into one application domain are distinct from the same type loaded into another application domain, and instances of objects cannot be directly shared from one application domain to another. Hence, the application domain itself forms a remoting boundary.
The VES implements contexts and remoting boundaries based on the concept of a proxy. A proxy is an object that exists inside one context and represents an object in another context. The proxy forwards references to instance fields and methods to the actual object for interpretation. Proxies do not forward references to static fields or calls to static methods.
The NGWS runtime implementation of proxies is provided automatically for instances of types that derive from System.MarshalByRefObject. The Remoting Specifications provide information about how to control the behavior of the proxies, including how to specify where instances of the class should be created, what channel should be used to communicate between the proxy and the implementation, what serialization format should be used to pass method calls to the implementation, etc.
To create types whose instances can be created in different contexts, the type must derive from System.ContextBoundObject, which itself derives from System.MarshalByRefObject. The Context Specifications provide information about how to configure the proxies to pass information about the context in which the instance is to be created, the context properties that control the passing of information across context boundaries, and so forth.