Originally posted by John Stone:
My suggestion: (just to have something to think about, perhaps it will give you some idea)
Create new interface, that will just have DatabaseExceptions. In this kind of exception you can chain all other exceptions, that can arise along the way.
Implement this interface by 2 adapter classes,
- 1. for working with remote database - handling remote exception and taking care of RMI
- 2. for working with locale database
And have your controller class access to one of these adapters and handle DatabaseException-s only.
I just realized this reading another trail in the forum. I was so focused on the "must throw RemoteException" so I didn't even think about wrapping it... So, actually, this works out perfect for me with minimal changes.
Thank you for the help