What are CAO's i.e. Client Activated Objects ?

Answer Posted / sarita rawat

Client-activated objects are objects whose lifetimes are controlled by the calling application domain, just as they would be if the object were local to the client. With client activation, a round trip to the server occurs when the client tries to create an instance of the server object, and the client proxy is created using an object reference (ObjRef) obtained on return from the creation of the remote object on the server. Each time a client creates an instance of a client-activated type, that instance will service only that particular reference in that particular client until its lease expires and its memory is recycled. If a calling application domain creates two new instances of the remote type, each of the client references will invoke only the particular instance in the server application domain from which the reference was returned.
In COM, clients hold an object in memory by holding a reference to it. When the last client releases its last reference, the object can delete itself. Client activation provides the same client control over the server object's lifetime, but without the complexity of maintaining references or the constant pinging to confirm the continued existence of the server or client. Instead, client-activated objects use lifetime leases to determine how long they should continue to exist. When a client creates a remote object, it can specify a default length of time that the object should exist. If the remote object reaches its default lifetime limit, it contacts the client to ask whether it should continue to exist, and if so, for how much longer. If the client is not currently available, a default time is also specified for how long the server object should wait while trying to contact the client before marking itself for garbage collection. The client might even request an indefinite default lifetime, effectively preventing the remote object from ever being recycled until the server application domain is torn down. The difference between this and a server-activated indefinite lifetime is that an indefinite server-activated object will serve all client requests for that type, whereas the client-activated instances serve only the client and the reference that was responsible for their creation. For more information, see Lifetime Leases.
To create an instance of a client-activated type, clients either configure their application programmatically (or using a configuration file) and call new (New in Visual Basic), or they pass the remote object's configuration in a call to Activator.CreateInstance. The following code example shows such a call, assuming a TcpChannel has been registered to listen on port 8080.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How are the activation URLs different in case of SAO and CAO in .NET remoting?

2087


What are the types of remoting?

537


What are static assemblies?

550


Can you pass SOAP messages through remoting?

567


What are the situations you will use singleton architecture in remoting ?

562






What does manifest consists?

541


What are the different types of channels used by .net remoting?

516


What are the information required to configure remote objects?

517


What is the difference between remoting and webservice?

523


Name the distributed systems available apart from .net remoting?

556


What is the purpose of strong name?

568


What are the ways to configure remoting objects before client can use them?

594


Are you aware of containment and Aggregation ?

2687


What are the ways to renew lifetime leases of objects?

573


Explain when we use web service and when we use remoting?

517