Paul,
I have a DBLocalAdapter class that implements DBClient, and this is used as the local adapter. I also have a DBRemoteAdapter, which implements DBClient and Remote, and this is my remote adapter. The DBConnector class will return the appropriate DBClient object based on the flag.
Do you have trouble compiling DBRemoteAdapter?
I followed part of the design from Peter Wooster in the Local Adapter Issue.
Here's the result:
1) Create an interface which extends only Remote and has all method signatures of DBAccess, but adds RemoteException.
2) The server implements this and contains an instance of Data.
3) On the client side, wrap the Remote Server reference in a class which implements DBAccess. DBProxy for example.
4) The client can now have a variable: DBAccess dbAccess, which represents either the local (an instance of Data), or remote (DBProxy).
-Paula