• 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

Implementing the Data Interface

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How are folks working with the DB interface? Do you put the object that implements it directly into your rmi registry, or are you making a wrapper object that you put in the registry?

I was doing it with the wrapper, but then that meant that the object in RMI wasn't actually implementing the DB interface, and I wondered if that would be a problem. But then, if you add the DBImpl class directly, you can't declare any of the methods throw RemoteException, which you're supposed to do with RMI objects, aren't you?
[ December 13, 2006: Message edited by: Rod Hilton ]
 
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
where does it read that your Remote has to implement the DB interface?
All it says is that your data access must be through it, it doesn't say that that data access has to be through your Remote.
 
Rod Hilton
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Right, that's what I'm asking. It seems that the logical thing to do based on the specs is to write a mindless wrapper class that just calls the real class, and register the wrapper in RMI.

This is what I explained I did, but I wondered if other people made the same pointless wrapper class or if everyone else did it differently.
 
Ranch Hand
Posts: 288
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Rod Hilton:
Right, that's what I'm asking. It seems that the logical thing to do based on the specs is to write a mindless wrapper class that just calls the real class, and register the wrapper in RMI.

This is what I explained I did, but I wondered if other people made the same pointless wrapper class or if everyone else did it differently.



No thats the right approach you can't have network functionality without some form of an adapter class due to the nature of the DB interface. Although since it has a purpose it's not really pointless after all.
 
reply
    Bookmark Topic Watch Topic
  • New Topic