• Post Reply Bookmark Topic Watch Topic
  • New Topic

Archecture - Local, Remote Servers

 
James Clinton
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The spec stipulates that this project must work in local and remote mode. Is the only way to achieve this is to have a LocalServer and a RemoteServer which are effectively identical except for the exceptions they throw?

-LocalImpl methods throw Exception
-RemoteImpl methods throw RemoteException

Thanks for your comments.
 
James Clinton
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've got round this problem catching the generic Exception and throwing a new RemoteException:



Is there a better way?
Comments welcome.
 
James Clinton
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've used the Adapter pattern to overcome my prob. much neater.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!