In the Common Language Run-time,
Application domain is a mechanism to isolate executed software applicationsfrom one another so that they do not affect each other. Each application domain has their own virtual address space which scopes the resources for the application domain using that address space.A Common Language Run time application domain is contained within an operating system process. A process may contain many application domainsThis carries major advantages
The CLR is like a mini-operating system. It runs a single process that contains a number of sub-processes, or application domains. Direct communication cannot be achieved across application domains. However, application domains can still talk to each other by passing objects via marshaling by value (unbound objects), marshaling by reference through a proxy (application-domain-bound objects). There is a third type of object called a context-bound object which can be marshalled by reference across domains and also within the context of its own application domain. Because of the verifiable type-safety of managed code, the CLR can provide fault isolation between domains at a much lower cost than an operating system process can. The static type verification used for isolation does not require the same process switches or hardware ring transitions that an operating system process requires. Managed code must be passed through a verification process before it can be run (unless the administrator has granted permission to skip the verification). The verification process determines whether the code can attempt to access invalid memory addresses or perform some other action that could cause the process in which it is running to fail to operate properly. Code that passes the verification test is said to be type-safe. The ability to verify code as type-safe enables the common language run-time to provide as great a level of isolation as the process boundary, at a much lower performance cost. |