I'm dealing with a situation where I am implementing RMI for the communications. I've got an client object instantiating a local copy of Data for local use, depending on user selection. In that same object, if the user chooses remote, I get a reference to a remote "servant" which wraps one local (as far as the server is concerned) copy of Data. I would like to use one reference in the client object to either the local Data or the remote "servant", but can't get a common reference. Has anyone else dealt with this, and how have you solved it? One way (brute-force) would be to remember which way (local or remote) and keep separate references and invoke the appropriate one.
You want to use both the remote and the local Data as if they were the same type, yet their implementations differ considerably. Hmmm... isn't that what interfaces were created for? interface DataInterface... class Data implements DataInterface... - Peter
Thanks tiny ad, for helping me escape the terrible comfort of this chair.
ScroogeXHTML 9.0 - RTF to HTML5 and XHTML converter