• 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic