Hello chandu,
>any body give exact explanation on how CAO and SAO can be used in remoting
application
You might get an even more fantastic answer by posting to
microsoft.public.dotnet.framework.remoting :-) But I'll give it a shot:
Server-activated objects (SAO) are called that because the server decides
if and when instances have to be created. Basically, only when the client
calls a method of the remote service, a message is sent to the server,
which then decides whether to create an instance of a certain class or to
reuse an existing instance.
SAO can use SingleCall activation, for which you register a type using the
RemotingConfiguration.RegisterWellKnownServiceType () method and pass in
the WellKnownObjectMode.SingleCall option. The other alternative is to use
Singleton Activation. To do this, you can either use the same registration
method with the WellKnownObjectMode.Singleton parameter, or publish an
object that has already been instantiated using RemotingServices.Marshal().
For SAO, a call to Activator.GetObject() is used on the client side.
Client-activated objects (CAO) are created on the server side, but the
creation takes place exactly at the point where some creation instruction
is encountered on the client side. This can be a call to
Activator.CreateInstance() or the "new" operator. On the server side, a
CAO type is made available by a call to
RemotingConfiguration.RegisterActivatedServiceType () and the client uses a
call to RemotingConfiguration.RegisterActivatedClientType( ), after which
instances of the remote object can be created just like normal client-side
objects.
Hope it helps.
Oliver Sturm
--
http://www.sturmnet.org/blog - MVP C#