Does client have to have all implementations or just interfaces?
In details: let we have remote interface Foo:
public interface Foo extends Remote {
FooMessage getFooMessage () throws RemoteException;
void setFooMessage (FooMessage fm) throws RemoteException;
}
Communication between client and server is happening by means of FooMessage.
public interface FooMessage {
String getMsg ();
void setMsg (String str);
}
The client is very simple:
public void clientCode () {
Foo foo = (Foo)Naming.lookup ("rmi://localhost/FooService");
FooMessage msg = foo.getFooMessage ();
msg.setMsg ("asdf");
foo.setFooMessage (msg);
}
Both Foo and FooMessage should have concrete implementations on server side. The question is: should client have these implementations too or RMI mechanism transfers implementations implicitly?