aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Server design Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Server design" Watch "Server design" New topic
Author

Server design

Miguel Roque
Ranch Hand

Joined: Oct 24, 2002
Posts: 126
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

Joined: Oct 24, 2002
Posts: 126
Hello.
Comments please.
Thanks,
Miguel
Raffe Paffe
Ranch Hand

Joined: Feb 24, 2003
Posts: 92
Hi,
Witch class is the one that starts the server? is it FBNServer ?
Thanks


Free software is a matter of liberty, not price.
Miguel Roque
Ranch Hand

Joined: Oct 24, 2002
Posts: 126
Hello.
Yes. I use FBNServer to start the server.
Miguel
Raffe Paffe
Ranch Hand

Joined: Feb 24, 2003
Posts: 92
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Server design
 
Similar Threads
Final comments
Local & Remote Data Intefaces
FBNS: Elegant design for client-side business classes
Review please.
A complicated database design...