• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Thoughts about client/server startup

 
b weiss
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey!

I wanted to get some opinions about the client/server start up.

I have the B&S project and wanted to know if others who have completed (and passed) or are in the process had it so that when the application is started and the grader puts in their location/port if a server is not presents just lets it error out...or if they presented the application window and gave an option to start the server later and connect to it. This option of allowing a user to connect to the db after the window has opened isn't in the UI/functional requirements but as far as just a consideration wondered if anyone has considered this compared to having the grader have to start the server before starting the client. Any thoughts would be greatly appreciated!!!
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy, B!

Well, in my case, if the server that the client indicated cannot be reached, the application displays an error message via JOptionPane, saying that the server could not be reached.

or if they presented the application window and gave an option to start the server later and connect to it.


Hum... if the window is displayed with the application not being connected to the server, what is the data that you will display? How are you going to fill your JTable? If a client tries to update a record (and where will this record come from?), what should happen in this case? This will have implications on several aspects of your application, including the locking mechanism, so in my opinion, I think it's better to only display the main window when the server is available and can be reached.
 
Jarek Losice
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Everybody,

I'm about to finish (I hope) my B&S assignment and I also have some questions to ask about starting the application:

I split my applications like that:
* in "alone" mode GUI starts with no DB opened, user is asked to point and open DB file first before operating.
* in network GUI mode GUI starts with no server connected to it. User is asked to point the server (host and port) he/she wants to connect to.

My question is about the "server" mode:
I think that it would we quite nice for a user starting the network server to point:
* the TCP/IP port number for server to run on
* database file to be used by server.
And since specification clearly states, that program must not require use of command line arguments (other than the mentioned flag) I assume, that I need to create some kind of simple GUI for "server" mode. Am I right? That GUI will be responsible for pointing the server port number, file to use and would allow user to start and stop network server by pressing buttons.

What do you think about it?
Thank ya'll ranchers,

Jarek.

 
Anne Crace
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just spent a couple days debugging this particular issue. I ended up adding a method to my controller to test the remote connection before displaying the window with the table. They get an error dialog if the connection can't be made. I haven't tried it on 2 computers yet but it finally works on 1! I did all my validation on the click of the "Connect" button because I tried keeping the buttons disabled until it passed validation, but the Backspace key became an issue. (Passed validation, then they changed it). My dialog doesn't go away until it can connect to a valid location, and I wrote a custom dialog class to display errors and other informative messages.
To Jarek: I think you've got the right idea!
 
Roel De Nijs
Sheriff
Posts: 9934
113
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Anne,

How can backspace key be an issue?

In my solution: when the field is exited, the entered value is validated and the observers are notified something was changed, so if the value was valid, connect button is enabled, otherwise disabled. When the user decides to change the value he entered (with backspace or another key), he will have to exit the field again and the "whole validating and notifying observers" thing starts over again.

Kind regards,
Roel
 
Roel De Nijs
Sheriff
Posts: 9934
113
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jarek,

You are correct. I created a small Server GUI where user can enter all necessary information and then he can start the server. If the server is started all input fields are disabled and the only thing that still can be done, is stop the server.

Kind regards,
Roel
 
Anne Crace
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roel:

I ended up going with an approach like K.Tsang used. He mentioned it in my thread about the remote exception. I don't think either one is more right or wrong, if they both work. I did a lot of searching on this issue, and found a thread suggesting validating on clicking the "Connect" button, and I tend to agree. While I think I probably have an issue with my observers and listeners, (I tried doing it the way you mentioned), I got it working with validation via the Connect button. This thing really needs to go "Bye Bye" very soon, so working is working, whatever way that may be!
 
K. Tsang
Bartender
Posts: 3406
13
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anne Crace wrote:Roel:

I ended up going with an approach like K.Tsang used. He mentioned it in my thread about the remote exception. I don't think either one is more right or wrong, if they both work. I did a lot of searching on this issue, and found a thread suggesting validating on clicking the "Connect" button, and I tend to agree. While I think I probably have an issue with my observers and listeners, (I tried doing it the way you mentioned), I got it working with validation via the Connect button. This thing really needs to go "Bye Bye" very soon, so working is working, whatever way that may be!


Hi Anne, I think you were refering to this thread.

 
Jarek Losice
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anne, Roel,

thanks for your prompt reply. So it seems I've got a little more work to do
Best regards,

Jarek.
 
Roel De Nijs
Sheriff
Posts: 9934
113
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anne Crace wrote:I don't think either one is more right or wrong, if they both work. This thing really needs to go "Bye Bye" very soon, so working is working, whatever way that may be!


That's both true and also very realistic in a real job, certainly when deadline is approaching very fast

Good luck with getting it "bye bye". I guess that will be an emotional moment for you
Kind regards,
Roel

 
Anne Crace
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
K.Tsang: Yes, that was the thread And, Roel the more I thought about, the bug (a duplicate line of code) that was causing me to have that problem in the first place, may have been what caused the backspace problem. I'm not done testing yet, and one of the things I want to look at is if the properties file is only populated with valid data if something gets changed. I'm pretty sure the listeners and observers are working now, however. Yes, it is time for me to upload the project.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic