This is my given interface from SUN. And I am trying to use RMI. but As you know, There is no throw RemoteException. So i am really wordering that does it possible if i extend DBMain interface ? Because my assignment sheet said
"Your data access class must be called "Data.java", must be in a package called "suncertify.db", and must implement the following interface".
and It doesn't mention about modification and extension, Only Said implements given interface. so I am really confused what should i do... some people said in this forum, Never modify and If You decide to use RMI. Adapter Pattern is the only way. But actually I don't understand well so...Plz help me the way as much detail as possible... Sorry for my poor English, And Thanks in advance.
Although you have to implement that class and use it to access the data file, you do not need to use that interface/class directly from your (RMI) client, do you? You could add another class in the middle, that has the same methods as that interface, but that includes RemoteException in the throws clause of each method. Your client will call the methods on this class, and these methods call the methods on Sun's interface. With this technique, you can change the method names and signatures of a class and still retain its functionalities. This is called the adapter pattern.