One process can have multiple Application domains
What is .NET Remoting ?
.NET remoting is replacement of DCOM. Using .NET remoting you can make remote object calls which lie in different Application Domains. As the remote objects run in different process client calling the remote object can not call it directly. So the client uses a proxy which looks like a real object.
When client wants to make method call on the remote object it uses proxy for it. These method calls are called as “Messages”. Messages are serialized using “formatter” class and sent to client “channel”. Client Channel communicates with Server Channel. Server Channel uses as formatter to deserialize the message and sends to the remote object.
Channels, Formatters and Proxy in action.
Which class does the remote object has to inherit ?
All remote objects should inherit from System.MarshalbyRefObject.
What are two different types of remote object creation mode in .NET ?
There are two different ways in which object can be created using Remoting :-
- SAO (Server Activated Objects) also called as Well-Known call mode.
- CAO (Client Activated Objects)
SAO has two modes “Single Call” and “Singleton”. With Single Call object the object is created with every method call thus making the object stateless. With Singleton the object is created only once and the object is shared with all clients.
CAO are stateful as compared to SAO. In CAO the creation request is sent from client side. Client holds a proxy to the server object created on server.
No comments:
Post a Comment