• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

DataClient

 
Ranch Hand
Posts: 688
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does anyone's DataClient implements an interface of some sort?
 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic