“Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.” - Rich Cook
SCJP J2SE 1.4<br />SCBCD J2EE 1.3
SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
So basically leave the interface as it is, and then when you write the class that implaments it you could make the methods throw any additional exceptions you see neccessary.
What you thought was right today may need a refactoring tomorrow...
“Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.” - Rich Cook
Extend the DCAccess interface to include the RemoteException.
It shouldn't as long as you extend the interface, not implement it. But that is moot anyway. After more consideration, I am inclined to agree with James and use the adapter patter.I think this will lead to a compiler error.
“Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.” - Rich Cook
It works for me eventhough you have 2 classes implementing DBAccess
Originally posted by Nit Kad:
I sm going to start on my assignment for SCJD exam. I downloaded the jar from Sun which included one interface which is supposed to be implemented by another class called as Data.java .
My question is that can we make changes in the interface provided by Sun. The reason I am asking because the DBAccess interface is perfect for RMI except that it doesn't have RemoteException thrown in any of its methods which is a required exceptions if an interface is supposed to be used for RMI.
Please advice whether the interface can be modified to add the RemoteException or not?
Thanks
Nit
Get meta with me! What pursues us is our own obsessions! But not this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|