• 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

Final comments

 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi.
I'm just reviewing my assignment and I'm planning to submit this week and have the exam next monday.
Please review and comment.
I've decided for modification of the Data class. The lock and unlock methods have been implemented in this class using it's reference as value in the lock's map. This way I can lock and unlock records in local mode when working in a multithread environment.
The Data class implements DataInterface that has all the public methods of the data class defined and extends Remote. This way I only have one interface that can serve in local and remote access (draw back is that RemoteException must be catched by the user of Data class).
Two classes implementing the DataInterface have been created, one for local access and other for remote access. The remote data class, besides a instance of Data, has a reference to a lock manager class that uses the client reference for the lock (a RMI factory was used in the server).
The local database implementation only has a instance of a Data class.
In the client side, besides all the GUI classes, I have a DatabaseFacade class that uses the local or remote data implementation depending on the connection mode.
Packages are as follows:
suncertify.client
-----------------
Gui classes
LocalDataImplementation.java
DatabaseFacade.java
suncertify.server
-----------------
FBNServer.java
RemoteDataImplementation.java
DataInterfaceFactory.java
RemoteDatabase.java
LockManager.java
suncertify.db
-------------
Data.java
DatabaseException.java
DataInfo.java
DataInterface.java
FieldInfo.java
suncertify.utils
----------------
Utils classes
Help class
I've decided to place LocalDataImplementation in the client and RemoteDataImplementation in the server package. Also the LockManager class as been moved to the server package as only the server uses it, so there is no point of placing it in the db package.
The reservation is executed in a separate thread that automaticly opens a dialog informing the user of what is being done. When finishes, a dialog is presented with the user on success or if some problems have occured.
The GUI as been implemented with a MVC. The model do all the operations needed by the FBN application, the views have "hook" methods that are defined by the controller.
On the top of the screen there is a menu and a border layout has been used. On the north there is the search panel and combo boxes for origin, destination and carrier followed by the search button.
In the center there is the JTable and in the south is the reservation panel.
Comment's please.
Thanks,
Miguel
 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I've decided for modification of the Data class. The lock and unlock methods have been implemented in this class using it's reference as value in the lock's map. This way I can lock and unlock records in local mode when working in a multithread environment.


The local database implementation only has a instance of a Data class.


The remote data class, besides a instance of Data, has a reference to a lock manager class that uses the client reference for the lock (a RMI factory was used in the server).


It seems you have different approach of locking between local and remote.
Kevin
 
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could you please descibe what you put in data lock/unloc and what you keept in your lockmanager?
 
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
Hi Raffe.
The Data class when opens a file creates a instance of a LockManager class and when a lock is called it calls the lock method in the lock manager class is called with two arguments, one is the record number and the second is the reference of the data class so that lock manager gets the client ID.
I forget to inform that in the remote side, when a instance of remote database is created, also a instance of a lock manager is created and it's used to perform the lock instead of this being done with the data class directly (we only have one instance of the data class no mater the number of clients).
Miguel
[ March 11, 2003: Message edited by: Miguel Roque ]
 
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
Hi Miguel,
so locking in local mode is done in LockManager in Data and in remotemode in LockManager in RemoteData ? I think I get it.
Hmmmm, do you feel 100 % about this?
 
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
Hi Raffe.
I've been thinking in this and I've came up with other soluction that i've placed in discution in this thread.
I'm waiting for comments.
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.
I've made some changes in the server so that it can work with or without parameters. If started without parameters, it will look for the database files in the current directory and will start listening in the default RMI port.
The parameters that are accepted by the server are the server port to bound to the registry and the directory where the database files are.
No databases are opened until the client request.
This was following some comments from Eugene.
Comments on my design please.
Thanks,
Miguel
 
reply
    Bookmark Topic Watch Topic
  • New Topic