• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

B&S: Question about DBMain

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi. All

Now I am working B&S with serious problem.

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.

-----------------------------
Jiwoong Lee
bluepopo@empal.com
SCJP 1.4
OCP 9i
SCJD(IN progress)
-----------------------------
 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Regards,
Dies
 
reply
    Bookmark Topic Watch Topic
  • New Topic