• 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 ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Local and Network Approuches

 
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.
 
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.
 
CLUCK LIKE A CHICKEN! Now look at this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic