Utility Objects



Utility Objects

The class AppDomain represents an isolated environment in which applications execute. You generally don't have to worry about creating them and using them; it usually happens behind the scenes. Unmanaged hosts such as the Windows shell and ASP.NET create an application domain and then load and run the user code within that domain.

The Type class (covered in Volume 1) is the basis for all reflection operations. Think of it as a class descriptor. When performing reflection, an internal token is sometimes used to represent a reflected type. A field (object member variable) can be represented by the class RuntimeFieldHandle, a method by the class RuntimeMethodHandle, and a Type object itself by the class RuntimeTypeHandle.

Since the .NET Framework is highly optimized for Internet programming, it contains a number of utility classes to ease the task of handling URIs (uniform resource identifiers). The class Uri is the basic representation of a URI, with methods providing access to individual parts of the URI such as the host name, and utility features such as hex escaping and unescaping. The enumeration UriHostNameType specifies the host name types for the method Uri.CheckHostName, and the enumeration UriPartial specifies the parts of the URI for the method Uri.GetLeftPart. The class UriBuilder provides a custom constructor for Uri objects and provides an easy way to modify an existing Uri.