For the Java Developer project, I am writing a remote interface. The remote interface looks like as below:
public interface DBI extends java.rmi.Remote{
public FieldInfo[] getFieldInfo() throws java.rmi.RemoteException;
//other methods of Data Class go here that
//will throws RemoteException
}
Next, I write a class called Server that implements the remote interface as below:
public class Server extends UnicastRemoteObject
implements DBI {
public FieldInfo [] getFieldInfo() throws RemoteException {
return description;
}
//all other methods found in remote
//interface go here
}
I have two queries:
Query 1: I am unable to compile the class Server because in the method getFieldInfo(), the variable description is not found. This description variable is found in the Data class as below:
private FieldInfo [] description;
Is that correct that I have to copy the above description variable and put that variable in the interface DBI or do I put this variable in the class Server that implements the interface?
Query 2: Is it OK that I used the same method name found in the Data class and used the same method name in the Remote interface or should I be using a different method name?
public interface DBI extends java.rmi.Remote{
public FieldInfo[] getFieldInfo() throws java.rmi.RemoteException;
//other methods of Data Class go here that
//will throws RemoteException
}
Next, I write a class called Server that implements the remote interface as below:
public class Server extends UnicastRemoteObject
implements DBI {
public FieldInfo [] getFieldInfo() throws RemoteException {
return description;
}
//all other methods found in remote
//interface go here
}
I have two queries:
Query 1: I am unable to compile the class Server because in the method getFieldInfo(), the variable description is not found. This description variable is found in the Data class as below:
private FieldInfo [] description;
Is that correct that I have to copy the above description variable and put that variable in the interface DBI or do I put this variable in the class Server that implements the interface?
Query 2: Is it OK that I used the same method name found in the Data class and used the same method name in the Remote interface or should I be using a different method name?