HOME

TheInfoList



OR:

An application domain is a mechanism (similar to a
process A process is a series or set of activities that interact to produce a result; it may occur once-only or be recurrent or periodic. Things called a process include: Business and management *Business process, activities that produce a specific se ...
in an
operating system An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs. Time-sharing operating systems schedule tasks for efficient use of the system and may also in ...
) used within the
Common Language Infrastructure The Common Language Infrastructure (CLI) is an open specification and technical standard originally developed by Microsoft and standardized by ISO/IEC (ISO/IEC 23271) and Ecma International (ECMA 335) that describes executable code and a runt ...
(CLI) to isolate executed
software application Software is a set of computer programs and associated documentation and data. This is in contrast to hardware, from which the system is built and which actually performs the work. At the lowest programming level, executable code consists ...
s from one another so that they do not affect each other. Each application domain has its own
virtual address space In computing, a virtual address space (VAS) or address space is the set of ranges of virtual addresses that an operating system makes available to a process. The range of virtual addresses usually starts at a low address and can extend to the hig ...
which
scope Scope or scopes may refer to: People with the surname * Jamie Scope (born 1986), English footballer * John T. Scopes (1900–1970), central figure in the Scopes Trial regarding the teaching of evolution Arts, media, and entertainment * Cinem ...
s the resources for the application domain using that
address space In computing, an address space defines a range of discrete addresses, each of which may correspond to a network host, peripheral device, disk sector, a memory cell or other logical or physical entity. For software programs to save and retrieve st ...
. Creating multiple application domains in the same process is not possible in .NET Core and .NET 5+.


Properties

A CLI application domain is contained within an operating system process. A process may contain many application domains. Application domains have isolation properties similar to that of operating system processes: * Multiple threads can exist within a single application domain. * An application within a domain can be stopped without affecting the state of another domain in the same process. * A fault or exception in one domain does not affect an application in another domain or crash the entire process that hosts the domains. * Configuration information is part of a domain's scope, not the scope of the process. * Each domain can be assigned different security access levels. * Code in one domain cannot directly access code in another. In this sense, a CLI is like a mini-operating system. It runs a single process that contains a number of sub-processes, or application domains. The advantage of application domains is that running multiple application domains may require fewer resources, such as memory, than running multiple operating system processes. Communication between domains still requires marshalling, so the overheads can be closer to using multiple processes than to communicating within a single domain.


Inter-domain communications

Direct communication cannot be achieved across application domains. However, application domains can still talk to each other by passing
objects Object may refer to: General meanings * Object (philosophy), a thing, being, or concept ** Object (abstract), an object which does not exist at any particular time or place ** Physical object, an identifiable collection of matter * Goal, an ...
via marshalling by value (unbound objects), marshalling 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 In computer science, type safety and type soundness are the extent to which a programming language discourages or prevents type errors. Type safety is sometimes alternatively considered to be a property of facilities of a computer language; that is ...
of
managed code Managed code is computer program code that requires and will execute only under the management of a Common Language Infrastructure (CLI); Virtual Execution System (VES); virtual machine, e.g. .NET, CoreFX, or .NET Framework; Common Language Runt ...
, a CLI 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

Application domains are a purely
managed code Managed code is computer program code that requires and will execute only under the management of a Common Language Infrastructure (CLI); Virtual Execution System (VES); virtual machine, e.g. .NET, CoreFX, or .NET Framework; Common Language Runt ...
concept. Any included
native Native may refer to: People * Jus soli, citizenship by right of birth * Indigenous peoples, peoples with a set of specific rights based on their historical ties to a particular territory ** Native Americans (disambiguation) In arts and entert ...
/unmanaged code (e.g., C++) is largely unaware of them. Static variables seem to be shared across domains, callbacks can be problematic, and any memory corruption bugs in one domain is likely to corrupt other domains.


References


codebetter.com blogMicrosoft Developer Network page on application domainsUnmanaged callbacks across AppDomains
{{Common Language Infrastructure Software architecture .NET terminology