Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI - Client code, Remote Interface and Data class - Classpath or Codebase?

 
Sudha Rams
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

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.

Regards,
Sudha
[ August 29, 2005: Message edited by: Sudha Rams ]
 
Raj Murthy
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

TIA,
Rajiv
 
Edward Harned
Ranch Hand
Posts: 291
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A, works for a testing environment. This way you compile/test the client/server easily.

B, works for a production environment. As you add more functionality to your product you don't want to have to ship new classes to every client machine; they get the new classes with the codebase.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic