• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Requirement for an assignment - one doubt !

 
Shivaji Bhosale
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a doubt, regarding the requirements ...
It states clearly ,
" The remote client code that you write must provide all
the public methods of the suncertify.db.Data class. "
In that case,
1. I will have to write implementation for each public method
at client side ?
Or otherwise,
2. just give a call to these public methods over server from client
side ?
I feel 2nd case is logical... Still I dont want to take a risk !
with regards,
Shivaji.
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It can be either. 1. would be the case if you chose to use the Adapter pattern, 2. if you would create a Remote object that implemented the Data interface.
- Peter
 
Shivaji Bhosale
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am naturally looking at 2nd option. In which I'll be having DataInterface extends Remote having all public methods within Data class declared.
Data will implement this Remote interface.
From my client, I will simply give a call to these, lock , unlock etc public methods from Data class which is a remote object got after Lookup.
I guess this makes sense. Please ...let me know if I interpreted wrong.
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Shivaji Bhosale:
Data will implement this Remote interface.
Everything looks alright, except this statement. Data itself should not implement any interface which extends java.rmi.Remote! Examine the contract for Remote as specified by the javadoc; it should only be implemented by real remote objects.
- Peter
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic