I got my beat assignment a week back and have some doubts ! Some in the assignment question itself and some in the Patterns, RMI. I am interested in discussing them. Please share your thoughts.
The assignment says that I should develop a Swing-Application to operate in network-mode and non-networked mode. And, the assignment also mentions that I should develop a small database server implementation with locking facility. (I was given the database-schema and the storage format)
Regarding the network & non-network modes, there are 2 ways in which the above can be implemented. They are:
(a) The Swing-Application can be run in both the database-server and in non-database-server (client machines used to access the database-server). The Swing-Application running in the database-server will use the "non-network-mode" to access the database and the Swing-Application running in the non-database-server will use the "network-mode" to access the database (using RMI).
(b) The Swing-Application can run in the database-server in non-network-mode and the Swing-Application can run in the non-database-server in network-mode. The Swing-Application running in the non-database-server can also run in the non-network-mode with its own local database (downloaded from the server, when the connection was last established).
The second implementation (b) is complex and has some drawbacks. The drawback being the local database not in sync with the live-database.
Can anyone clarify which one is to be implemented?!
Regarding the database server functionality, I thought of using a singleton pattern - Have only one instance of the database running in the server and let all clients access the database use this instance. Are there any drawbacks in this method?
Also, I thought of having a synchronized method for update() operations. And, implement the lock concept in this method. Is there another method to implement the lock concept?
Regards,
Dayanand.