Hi,
I am very confused with the local-remote Data classes implementation. I went through some of the other messages in the discussion board but it didn't help me.
My initial design looks like this:
interface DataInterface
{
//all the public methods of Data class
}
class LocalDataClient implements DataInterface
{
protected Data data;
//All the methods calls are delegated to the Data class
}
class RemoteDataClient extends UnicastRemoteObject implements DataInterface
{
protected Data data;
//All the methods calls are delegated to the Data class
}
class DataAccessor
{
DataInterface dataObj;
//Using polymorphism, at runtime, based on local or remote
dataObj = new LocalDataClient() or
dataObj = new RemoteDataClient()
}
Questions:
1. Please comment on this design. Is it right ?
2. Should the DataInterface extend Remote. In that case , should all the methods in LocalDataClient throw RemoteException eventhought they are not going to do any RMI calls ?
Thanks in advance.