Hi James,
I need to implement two Data classes.
1. LocalData.class (implements LocalDataIF) Doesn't throw RemoteExceptions.
2. RemoteData.class (extends UnicastRemoteObject implements RemoteDataIF) does throw RemoteExceptions.
Each with there own interface, because ofcourse as you say, only remote objects throw RemoteExceptions.
I would advise against this: it is not very object orientated - you will end up with almost identical code in both your classes.
My recomendation would be to develop a more modular solution. In this case, you will develop a Data class, that only implements LocalDataIF. Do not worry about how this connects to the outside world for the moment - all you are developing is a Data class that provides access to the Data.
Once you have your Data class built and working, you can then start to think about how you connect to it. You can then build another class to provide remote access to the Data class. From what you have been describing, you are planning on using RMI. So this new class would provide your RMI access. You can also create a class to provide local access to the Data class if necessary.
Since this approach is modular, you could have other classes as well, all providing different forms of access. This makes it nice and extensible for the future. Say for instance that a later requirement was for MQ connectivity. Since this is modular, you can just add another class which does the MQ work.
This approach also means that you do not have one class trying to do too much work. In trying to do too much work, your class will become bloated, hard to understand, and hard to add functionality. A general rule of thumb is: whenever you describe a class,
you should try and avoid AND or OR statements in your description. The way you were trying to describe your Data class would have been something like "Accesses the data, AND provides either RMI OR local access to the data".
Regards, Andrew