v In execution of Remoting application clients needs object of remote class to invoke methods under it. Activation Models decide where the remote class objects resides in execution of the application.
v Remoting supports two different activation models.
· Server Activated Objects(SAO)
· Client Activated Objects(CAO)
v In SAO model object of remote class resides on server machine and a reference of this object is maintained on the client machine using which clients can invoke the methods of remote class.
v In CAO model the object of remote class resides on client machine using which clients can invoke the methods of remote class.
Server Activated Objects(SAO) :
v In SAO model we were again provided with two types like singleton and singlecall
Singleton: In this case whenever a first request comes from a client an object of remote class gets created and it’s reference is given to the client, from then every new request coming from a new client, server provides the reference of same object which is already created, so changes made by one client gets reflected to the other. Used in the development of application like Public chat, Cricket scores, share prices etc,
Single Call : In this mode whenever a request comes from a client one object of remote class gets created and it’s reference is given to client, once the request is served immediately object gets destroyed without allowing him to make any other requests on that object, for a new request a new object gets created again and destroyed. Used in the development of single request application like “Railway PNR Status Enquiry”, “TM Machines” and “Examination Results”.
Note : This is very highly secured model used in applicaton development.
Client Activated Objects(CAO) :
In this case whenever the first request from a client an object of remote class is created and provided using which the client can make any number of requests. Here a separate object will be given for each client so changes made by one client will never reflect to the other. Used in the development of applications that requires multiple requests for a single client like “ Traditional ATM Machines”, where we can perform multiple transactions once we insert the card.