I am not clear as to why should the client class implement all the public methods of the Data class .If we write an RMI server which implements all the public methods and export it to the client as well as adding the client to a vector in the server by putting a client stub in the server classpath ---it appears to work.
As the data class is on the server side, to ensure your client application will also provide the same services as the data server can help, it requires u to implement all the methods as the data server has.
Joined: Apr 19, 2001
To RMI implementation, I think developer can just make an interface which has all the methods included and this interface extends Remote, and deploy it on the client side application, this can fulfill the requirement. As I did it just as the same way.
Anil Sharma , Welcome to javaranch. PROPER NAMES ARE NOW REQUIRED Please look carefully at official naming policy at javaranch & reregister yourself with proper last name. Please adhere to official naming policy & help maintain the decorum of the forum. Waiting for your posts with proper last name. Once you have reregister , please let us know about that & then your previous account will be disabled. Regards.
If the Data class implements Remote, then how can the client use it when it is operating in local mode? I am thinking that I might create a proxy class on the server, which implements the data interface, and then have this class pass on the requests to the Data object. Then on the client side, it can instantiate the Data class.
If the data class implements the remote interface then the client just uses an object which implements that interface .... whether it is local or remote is irrelevant Regards Conor
Joined: May 25, 2001
Hi Conor, Do you mean that the client should perhaps implement the same interface that the Data class on the Server is implementing in this way we can just have a reference to that interface no matter if it is remote or local.Can you give me any other purpose of implementing the methods of the Data class on the Client apart from the fact that they can be used in the local mode.
Joined: Apr 27, 2001
To be honest, I am not sure how good an idea it is. It does mean that you can provide a remote interface to the Data class which can then be reused for any database which needs that type of functionality. Clear as mud??