Andrew and Werner, thank you for your quick response! What I understand is that another interface has to be defined to solve the problem. Suppose that another interface called AnotherDBMain is defined as follows:
public String[] read(int recNo) throws RecordNotFoundException, RemoteException
public int[] find(String [] criteria) throws RecordNotFoundException, RemoteException
����
In addition, another adapter class which has a reference to a Data instance as its member variable is also needed to implement the new interface AnotherDBMain. Actually the implementation of methods in the new interface AnotherDBMain depends on the data access methods of the Data instance.
public class DataAdapter implements AnotherDBMain {
private Data data = new Data();
public String[] read(int recNo) throws RecordNotFoundException, RemoteException {
return db.read(recNo);
}
}
In the implementation of rmi, the method declarations of those classes and interfaces should look like follows:
public interface AnotherDBMainRemote extends AnotherDBMain, Remote
public class DataRemote extends UnicastRemoteObject implements AnotherDBMainRemote
A DataAdapter instance is included in class DataRemote as a member variable to do the actual data access operations. At client side AnotherDBMain is used to be the data access interface.
Am I on the right trail?
And before reading the posts, I think it is unquestionable that extra methods can be included in Data.java. However, now I am lost. I cannot read out such an implication from my instructions. I want to know whether on
earth extra methods can be added in Data.java.