• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RemoteException Revisited.

 
Arun G Rao
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had the same exact question that is discussed in the following thread.

Remote Exception Issue started by Song Jing Lim

Andrew, Your solution makes perfect sense. I was leaning towards the same TILL I saw the sample code from your book. In your book, you are creating a DVDRemote interface that extends DBClient and Remote.

And the Impl class goes on to implement the DVDRemote interface. There are methods that throw RemoteException! How did you make this happen?

Thanks
Arun
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12007
215
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Arun,
From page 119:
As mentioned earlier in this book, there are several areas in our sample project where we feel we must deviate from the project provided by Sun. Nowhere is this more important than with the classes presented in [the DvdDatabase Class chapter]. Either the code used in this section of our sample assignment will quite often be more detailed than your assignment requirements, or we will use shortcuts that you cannot use in your assignment. In particular, we specify that java.io.IOException can be thrown in our interfaces and classes, greatly simplifying our development;
That little simplification (having all our methods throw IOException) allows us to implement Remote - RemoteException extends IOException. From memory, we have listed this a bit more explicitly somewhere else in the book (but I can't find it right now).

Regards, Andrew
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic