Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Implementing the Data Interface

 
Rod Hilton
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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 ]
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Mark Smyth
Ranch Hand
Posts: 288
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic