I finally come up a brief design although there are still lots of confusion and details. Any comments or advice is highly appreciated!
=========================================
I have 3 pachages: client, server and db:
db:
===
DataInterface.java:
all the public method in Data.java
Data.java:
implement DataInterface.java, used in remote mode, lock () and unlock () are implemented here.
DataLocal.java:
extends Data.java, implements DataInterface.java, used in local mode
DataInfo.java:
as given
FieldInfo.java:
as given
Server:
=======
DataServer.java:
DataServerImpl.java:
Client:
=======
FBNClient.java:
the GUI, and user can switch between local and remote modes
ClientInterface.java:
methods over the database, like searching, booking.
RemoteClient.java:
implement ClientInterface.java, used in remote mode to connect to the server
LocalClient.java:
implement ClientInterface.java, used in local mode, thus directly access the local file.
What I am not sure is if I can put the "booking"
method on the server in remote mode while put
everything on the client in local mode (of course,
since no server is involved in local mode). What
confuses me is how the client can really implement the operations like "booking", and if this is the case, what the server does here.