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

DataClient

 
Adrian Yan
Ranch Hand
Posts: 688
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anyone's DataClient implements an interface of some sort?
 
R Bischof
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I changed the Data class to implement the interface DataInterface which defines all public methods of Data. I have a client side class called RMIDataAdapter which implements the same interface and encapsulates the RMI communication with the server.
This way the client may use either the Data class itself or the RMIDataAdapter in the same way, just addressing it through the interface DataInterface. So there is only one row in the DataClient that knows the difference.
Since RMI may throw RmeoteException on every call the RMIDataAdapter transforms these RemoteExceptions into DatabaseExceptions (actually a subclass of DatabaseException that provides detailed information about the original RemoteException).
HTH
Rainer
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic