• 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

Server design

 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello again.
Please review the database and server design.
I've created a DataInterface that extends Remote. This interface implements all the methods from the Data class and besides the exceptions throw by the Data class it also throws RemoteException. The Data class extends this DataInterface.
The access to the Data class or to the remote server is made using a DatabaseFacade class that has two constructors, one for local access and other for remote access) and both constructors create a DataInterface instance that's used internaly by this class. One thing in this class is that it catches all the exceptions throw either by the local Data class or by the remote server and only throws a DatabaseFacadeException. This way, the final user of this class doesn't have to catch a big amount of exceptions.
For the server, I've created a RemoteDatabase class that creates a instance of the Data class and a instance of LockManager. I have a RemoteDataImplementation that accepts a RemoteDatabase as constructor parameter and defines all the methods from the Data class, but using the instance of the Data class created by the RemoteDatabase class.
I have also a DataInterfaceFactory interface that defines a method that accepts a database name and returns a DataInterface instance (the server can open more that one database). This interface is used by the FBNServer class that when created just has a method that comes from the interface and it's used by the DatabaseFacade to get a instance of a remote Data class.
Please comment.
I think that i've been clear in my explanation
Thankc,
Miguel
 
Miguel Roque
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello.
Comments please.
Thanks,
Miguel
 
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Witch class is the one that starts the server? is it FBNServer ?
Thanks
 
Miguel Roque
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello.
Yes. I use FBNServer to start the server.
Miguel
 
Raffe Paffe
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you.
A few Questions.
So in FBNServer class constructor you create a RemoteDatabase for each db and you start up your server in main?
The only additional method is getDatabaseInstance and that one is remote?
Thanks
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic