Hi,
I am thinking about the solution for two days and I am desperate now
Please HELP
In my solution, in some degree, I follow the book "
SCJD Exam with J2SE 5".
I have a problem with proper Object Oriented design related to GuiController class.
My design as it is now:
LOCAL OBJECTS DESIGN:
Interface provided by SUN: DBClientDBClient "must have according to instruction from SUN" implementation class: Data
RMI OBJECTS DESIGN
To support RMI I created new interface: DBR (contains all methods from DBClient with RemoteException declared)Interface to be exported by RMI is: remoteDB (extends Remote, DBR)Class implementing remoteDB: RemoteDBImpl (implements remoteDB) - this class nicely wraps all exceptions and rethrows RemoteException if neeeded.
The most simple solution for me would be to create separate controller for local mode and other for network mode, however it seems to be lame...
How to overcome the issue with DBClient and remoteDB not being compatible....
I tried to create next interface, extending both DBClient and remoteDB and then by some type casting obtain proper reference however it failed....
My goal is to obtain a controller reference like in the example solution:
best regards,