Given that we have:
A interface DataInterface resides in suncertify.db;
A interface RemoteData, which extends Remote, resides in suncertify.server;
Now we have a package named suncertify.client, in which package, we want to dynamicly change data's resource: either from local or from network.
We can write a class ClientData implements suncertify.db.DataInterface. ClientData works like a wrapper of RemoteData, that is, use try--catch to hide RemoteException.
Now, given we have suncertify.client.Client, we can set Client's data like this:
In this way, we can dynamicly change DataInterface in Client.
In one
word, the point is to create a class (ClientData) to implement DataInterface, and to wrap RemoteData (that is, catch RemoteException in method, instead of throwing it).
[ July 16, 2003: Message edited by: Xiao Qinglai ]
[ July 16, 2003: Message edited by: Xiao Qinglai ]