An NGWS application consists of one or more assemblies and runs within an Application Domain (also known as an AppDomain). Running an application in an AppDomain provides the ability to isolate one application from another application running in a different AppDomain. There can be multiple AppDomains in an OS process. An application running in an AppDomain is isolated from all other applications in all other AppDomains within the OS process and applications running in AppDomains in processes on the same machine or AppDomains on different machines.
AppDomains are hard boundaries. Applications running in different AppDomains share no information, no global variables, no static fields on classes. NGWS runtime remoting is used to communicate between AppDomains.
All communication between objects in a NGWS application is highly optimized for local access to fields, methods and properties.
Figure: Local Application
All communication between AppDomains is through messages and proxies.
Figure: Local Application with Remote Application in different AppDomain in the same process
All communication between AppDomains is through messages and proxies. Messages are encoded by the channel and sent. In the receiving application the message is decoded and dispatched to the application.
Figure: Local Application with Remote Application in different AppDomain in another process on the same machine.
All communication between AppDomains is through messages and proxies. Messages are encoded by the channel and sent. In the receiving application the message is decoded and dispatched to the application.
Figure: Local Application with Remote Application in different AppDomain in another process on a different machine.
NGWS runtime remoting provides the capability that assemblies that make up the Application can be configured to be part of the Local Application or part of one of many Remote Applications. If the assembly is configured to be part of the Remote Application (using NGWS runtime remoting Configuration), then when classes in that assembly are instantiated, a “proxy” is returned to the Local Application.
In the NGWS runtime, objects can be instanciated from classes in a number of ways: calling new on some class e.g. “new SomeClass()”, calling Activator.CreateInstance or calling Activator.GetObject (GetObject returns a proxy to a well known WebService object in a Remote Application).
All calls on the proxy in the form of instance method calls, instance field and property access are routed to the remote application in the remote AppDomain.
Using NGWS runtime remoting configuration enables the user or administrators to specify which assemblies run within the local application and which assemblies run in remote applications.