This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
My RMI client consists of a Java command-line app that uses Naming.lookup to obtain a reference to the remote interface. Also, I have a data class that is used by both the RMI server components and RMI client components. This is the return type for the remote method invoked by the client.
What is the correct approach out of the options given below?
a) Include the remote interface and the data class in both the build and execution classpath. This is inevitable and is the only way to compile and execute the client app and remote implementation.
b) Include the remote interface and the data class in the build classpath. This is inevitable during development and is the only way to compile the client app and remote implementation code. However, at the time of execution, one may just mention the codebase so that the remote interface and/or data class bytecode gets downloaded. This is applicable to both the client app and the remote implementation.
Also, if there is any other approach apart from the ones that I have mentioned, please let me know.
So far we have been including the server and shared classes in both server and client machines. The client dynamically getting the stubs and shared-classes would be preferable. What would be the performance implications, if any? Please let me know if you post some command/code snippets that might help.