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

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: 17278
6
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic