• Post Reply Bookmark Topic Watch Topic
  • New Topic

Switching modes for local/network client

 
Reshma Das
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Iam confused with design for Switching modes for client.
I was planning to write Interface1. Then implement them in 2 different interfaces LocalInterface ,
RemoteInterface which throws Remote Exception
both of them will implement the public methods for Data class.
My serverclass will extend RemoteInterface.
In my client i will have
if( i==1)
interface1 = new Data();
else
interface1 = (RemoteInterface)
Naming.lookup(
"rmi://localhost:1099/RemoteServer");
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's pretty much looks like my DataAccessFactory class. It looks at what was passed in the arg[] in the main method of my client, then do about the same as yours.
Mark
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!