• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

start client and server

 
christy smile
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, all,
I have a basic design question about the project.
In the specification, it says that the "program must be able to work in a networked and non-networked mode". How do the user choose which mode they'd like to run the program? Currently, I am thinking about providing a Welcome screen that allows the user to choose either network or local mode. The network mode has hostname, port number and db name fields. If the network mode is selected, the DataServer will be started and a DataClient will be started right after it.
Or, does the project intends the grader to start the server with a specific database first, then the client could choose whether their application is going to use the networked mode or the local mode? And the client will just start its side of the application?
Please clarify this for me. Thank you very much!
Christy
 
Trevor Dunn
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A couple of observations
1. It seems that when you want networked mode you start a server.Why?. The server should be separate from the client.
2. It also seems that you are passing in db field names as a command line parameter. The spec gives you specific paramters you are allowed to use and that is not one of them. Besides that information can be extracted from the database.
3. When your client starts it does not matter how you choose networked or non-networked mode. People have used GUIs and enables switching on the fly, I determined it by the number of command line arguments passed to the client. It is up to yourself.
Trevor
 
christy smile
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Trevor,
Thank you for your response.
So you are saying that the server should always be started by a separate process (or thread) ahead of time. There is no GUI needed to be provided to start the client in the either the network or non-networked mode, the user uses the command line arguement to determine that? I understand that for the network mode, the client cannot choose the database to use because server has already preselected a database; however, in the non-network mode, should the client be able to choose the database to use?
Thank you.
Christy
 
Trevor Dunn
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you are saying that the server should always be started by a separate process (or thread) ahead of time.

Yes, the server should be started ahead of time.

There is no GUI needed to be provided to start the client in the either the network or non-networked mode, the user uses the command line arguement to determine that?

It is your choice on wether you want a GUI or not

I understand that for the network mode, the client cannot choose the database to use because server has already preselected a database; however, in the non-network mode, should the client be able to choose the database to use?

Yes it should be in your gui or command line arguments, depending on how you implement it
Trevor

[This message has been edited by Trevor Dunn (edited December 10, 2001).]
 
christy smile
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Trevor,
Thank you for the reply. I have another question about starting the server. Currently in my code, I used InetAddress.getLocalHost().getHostName() for the server to bind with the RmiRegistry. There is one problem, this getHostName() would only return the hostName and ignore the domain name. How do I include the domain name for the hostname in the binding. Thank you very much.
Christy
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic