i\'m preparing for an exam and I\'m having a question that I hope someone here could answer me.
It\'s about RMI and remote objects. I wonder why there is so much differe
There are two questions here.
You can either extend UnicastRemoteObject
or call UnicastRemoteObject.exportObject().
Which you do is up to you. The first is simple and automatic; the second means you can extend another class.
You can either use an external RMI Registry or create it yourself inside your server JVM. Again which you do is up to you, there are advantages both ways.
These two questions have no interaction.
If you extend UnicastRemoteObject
you also get the benefit of 'remote semantics' for the hashCode()
and equals()
methods, such that all stubs appear to be identical to the remote object that exported them, but this is of no practical use on the client side, and is really only there to support the RMI implementation itself.