What is an application domain (appdomain)

What is an application domain (appdomain)

Before .NET framework 2.0 technology, the only way used to isolate applications running on the same machine is by the means of process boundaries. Each application run within a process, and each process has its own boundaries and memory addresses relative to it and this is how isolation from other processes was performed.

.NET framework 2.0 introduces a new boundary called the Application Domains.

Application domain is nothing but a boundary within which an application runs.
process can contain multiple application domains. Application domains provide an isolated environment to applications.

An application running inside one application domain cannot directly access the code running inside another application domain. To access the code running in another application domain, an application needs to use a proxy.

Application domain is used to isolate executed software applications from one another so that they do not affect each other. This is achieved by making any unique virtual address space run exactly one application and scopes the resources for the process or application domain using that address space.
The .NET runtime enforces AppDomain isolation by keeping control over the use of memory - all memory in the AppDomain is managed by the .NET runtime, so the runtime can ensure that AppDomains do not access each other's memory.

Application Domain is used to create a mirror image of an application. reason being if you do not want to stop OR
down the site , .Net framefork give u feature called App Domain, through which u can make the changes and uploaded
to the site without getting it down or Stop.

The main advantage is the ability to run several applications domains in a single process or application. All of this is performed while maintaning the same level and quality of isolation that would exist in separate processes, without the need of making cross-process calls or switching between processes.

isolation, code running in one application domain can not access code or resources running in another application domain.
security, You can control the permissions granted to a given piece of code by controlling the application domain inside which the code is running.
robustness, error in code running in one application domain can not affect other applications although they all are running inside the same process. Individual application domain can be stopped without stopping the entire process, you can simply unload the code running in a single application domain.
They are less expensive than full processes
They are multithreaded
You can stop one without killing everything in the process
Each app domain runs on its own security level

Reference: Muthukumar (http://nadarmuthukumar.blogspot.in/)
netsqlinterviewquestions, dotnetfunda, crazyengico, allinterview


Twitter Delicious Facebook Digg Stumbleupon Favorites More