• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

B&S: Question about DBMain  RSS feed

Posts: 5
  • Mark post as helpful
  • send pies
  • 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
SCJP 1.4
OCP 9i
SCJD(IN progress)
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • 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.

Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!