The server GUI is as simple as a textarea and start, stop, exit button. The client windows has sime screen resolution issue, so I used the java.awt.Toolkit.getDefaultToolkit().getScreenSize() so that it uses the screen size irrespective of its resolution. There are testing scope though and I am not using full screen to be occupied by my client GUI.
Good point about using java.awt.Toolkit. I am using that to get the screensize as well. I think (hope) it should be okay. In addition, aren't you using the events from java.awt.event to handle some of the window events as well? THat's not considered strick Swing either, right?
BTW, I have a question about your Stop and Exit button. What do they do? I have a Stop button and a Quit menu. Stop would stop the current server sessoin, Quit would stop the current server session and exit the app completely. Then I ran into the problem of closing down the RMI registry with the Stop button. Did you figure out how to close the RMIRegistry or how to tell there is already an instance of RMIRegistry running in the code?
I am not allowing the user to resize the GUI both of server and client.
You are certain to lose points for client GUI design if you don't allow the window to resize. Take a look at any well-designed Java app, such as JBuilder, -- all windows are resizable. Not allowing the windows to resize is a old and sloppy Microsoft way of doing GUI design.
These are relatively easy implementations plus if you used the proper layout managers the resizing issue is really a non-issue.
Thank you for the input of the resizable windows. Mine are resizable originally, then, I thought for changing ... now I've decided not to.
What are your comments about this question then?
"Good point about using java.awt.Toolkit. I am using that to get the screensize as well. I think (hope) it should be okay. In addition, aren't you using the events from java.awt.event to handle some of the window events as well? THat's not considered strick Swing either, right?"
Christy, to detect an already running RMI registry, do something like
I am using Flow, Grid, Border, BoxLayoutManagers divided in panels. So I thaught resizing my window will compell to increase my test time while I'll code everything in two days only (12,13) by taking a leave from office. If I get time, I'll allow and test resizing effects. I admit it should be done but not must be done.
I am planning to use a connection manager that will work as a factory and ask at startup through GUI whether to connect in Non-networked mode (local) or Networked mode (Remote). If local mode is chosen then it will be taken to DBAccessManager that will connect db.db file locally. If remote mode is chosen, then connection will be made to remote server that will access the dbd.db file via DBAccessManager.
My plan about RMIRegistry is that it will be started at the beginning and will not be disturbed until exit of application. Rather I am planning to use start server as a simulation that the server is just starting though it has already been started but was not ready to accept user request. After the server administrator presses start server button, it'll accept user request and whenver the administrator presses stop server button, it starts refusing client requests. Exit button will actually stop functioning of the server and quit the application.
These are all still plans and highly depends on time availability and problems faced when actual coding starts. If very short of time, I'll remove the server GUI and simply directly give connection to the DBAccessManager.
Suggest me ont his design and specially if you feel its going to break some rule of thumbs.
You might be able to answer my following question since you had a similar Server GUI design as mine.
I have a question about the server shutdown.
For my server GUI, I have a stop button and a Quit menu. All stop button does is to unbind the database and Quit menu exits the whole application. I noticed that if I just stop the data server, the client seems to be still connected to the server somehow, meaning that it can still search and book the flights
If the whole application is exited, I will get connection exceptions. Am I doing the right thing in Stop? Or should I do something more than just Naming.unbind(...)?
Did you notice that behavior with your server code?
1. Unix daemon started non-interactively using a System V style init script
2. As a Windows Service
Neither of which assumes some sysadmin with oodles of free time staring at the GUI to make sure everything is OK. How valuable is the "Stop the service but leave the UI and JVM running" feature? Don't add more requirements. If you must do a GUI, just do an on/off type thing. For what it's worth, my guess would be that the remote references to your server object that were already established before you removed the object from the registry are still valid and functional, but I bet if you tried to start up a new connection, you would get a not bound exception.