Application Domains


.NET remoting allows you to easily develop highly distributed applications in which an application running in one application domain can access the properties and methods of another class running in a different application domain. An application domain is an isolated operating environment where a .NET assembly can execute. You can think of an application domain as a process in a traditional operating system. The application domain provides isolation for your application and its operating system resources from other applications. However, an application domain is not a process at all, because a process in the .NET world potentially can have more than one application domain. In fact, every process has at least one application domain that is known as the default domain.

The .NET remoting infrastructure provides a mechanism that allows your application to seamlessly access class types across application domains. In Figure 12-1 you can see that one or more application domains can operate within a process. Process A has two application domains, X and Y. Figure 12-1 also shows you that class type 1 in application domain X is accessing class type 2 in application domain Z. .NET remoting provides the channel of communication needed for class type 1 to access class type 2.

click to expand
Figure 12-1: Application domain overview

The nice thing about application domains is that you can isolate the running of class types. If a class is running in another application domain in your application and crashes, it will not harm the rest of your application running in another application domain, such as the default domain.

A remote class type is a class library running in another application domain. The ability to communicate over a network to access remote class types in another application domain without having to deal with the semantics of the network layer is one of the greatest strengths of .NET remoting. When an application accesses properties and methods of a class in another application domain, the process is known as crossing application domain boundaries. Crossing application domain boundaries can be accomplished only by using .NET remoting channels.




Network Programming for the Microsoft. NET Framework
Network Programming for the MicrosoftВ® .NET Framework (Pro-Developer)
ISBN: 073561959X
EAN: 2147483647
Year: 2003
Pages: 121

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net