• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Local and Network Approuches

 
Michel Bertrand
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello !
I have a doubt about my network approuch. I used RMI to implement the network operations. In the way I designed my classes, the remote
interface is used for both local and network database access.
Running my client to access the database locally, I simply get a
local reference of my remote interface for the database. Running it to access a remote database, I get a remote reference of database using .
I found in my assignment some instructions to bypass the network entirelly running the database locally. And so, my doubt comes here, because in my approuch I'm using the remote interface for both local and network data access. Even running locally I use the stubs of RMI.
Could it be result in an automatic fail ? What do you think about this
application design ?
Thanks in advance !
Michel.
 
Jacques Bosch
Ranch Hand
Posts: 319
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Michel.
Yes, that will probably result in a fail. You must not use any network code in your standalone mode.
Following Ken's advice, what I did, was to write a direct / local client to get at the data. Then, on both the server side, and the client side (in network mode) I used a adaptor pattern to make the network client look just like the direct / local client interface.
I.e. On the server side, I adapted the local client to work with RMI (remote just delegates to local), and on the client side, I adapted the remote RMI code to work as a local client.
Michel, I must be tired or something... I just read what I wrote. I hope you can make sense of it. Not sure I can.
J
 
Michel Bertrand
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply ! That's what I supected ! I will change the architecture.
Regards,
Michel.
 
Jacques Bosch
Ranch Hand
Posts: 319
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure thing.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic