Tech moves fast! Stay ahead of the curve with Techopedia!
Join nearly 200,000 subscribers who receive actionable tech insights from Techopedia.
In the .NET Framework, context is a set of properties that defines the environment for its residing objects. It specifies the object requirements of an application domain process as an ordered sequence of properties.
Context is used to group objects with similar requirements for its operation. More than one object may reside in a context. A context object may be used to transmit values between Web pages. Unlike a session object, a context object goes out of scope when the page is sent to the Web browser.
Context usage has become obsolete, due to Microsoft's recommendation of Windows Communication Framework (WCF) technology for distributed application development.
Context-bound objects are marshal-by-reference (MBR) objects with enforced system rules. When a new context-bound object is created, the .NET Framework locates an existing context or creates a new context for that object. The context is based on the metadata attributes of the class specified with static-context properties during compilation.
Administrators may dynamically configure context properties. Communication between two objects that reside in different proxies is implemented via a reference proxy and is affected by the policy implemented by combined context properties.
Application domain and context-specific remote objects require successful application and context boundary crossing by the remote server object invocation system, which consumes processing resources. Thus, extending the remote object type from the right base class based on the application requirement is recommended.