This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Client Startup and options Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Reply Bookmark "Client Startup and options" Watch "Client Startup and options" New topic
Author

Client Startup and options

Kalichar Rangantittu
Ranch Hand

Joined: Jan 15, 2002
Posts: 240
The requirements say the following:
"You can choose between RMI and Socket. In either case the program must allow the user to specify the location of the database, and it must also accept an indication that a local database is to be used, in which case networking must be bypassed entirely".
I am unsure of the above. Does this mean the client can specify the location of the remote database to connect to? How could that work, a client may run on a WIN NT box on Europe while the server may run on a Solaris in Kansas? Is it acceptable for the user to speceficy the location of the remote database like "/home/blah/blah/db.db" when connecting remote? Shoulnt this be transparent to the user?
Please supply your valuable inputs in the matter. This requirement is quite vital as then when starting the server, one would not need to specify the remote database???


Never be satisfied with anything less than the best and you will surely pass the test...
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17233
    
    1

Does this mean the client can specify the location of the remote database to connect to?

Yes. That means if the server is on a solaris in another country there needs to be an ip address that you can use when starting the client to tell it where to find the server.
As far as when you start the server, the db.db file will most likely be in the same directory.
The reason why this is acceptable is in the requirements. It states there are about five things you can have the assessor to type in as arguments to starting the client, and one of them is the location of the server.
You need this in case they move the server, the client never has to change.
You can supply any means for the client to receive the location of the server. Via command line parameters, a startup screen that the user can chose either local or remote mode, and if they chose remote you have a JTextField that allows the user to enter the "URL" of the server.
Some people have even made the client have a menu item for chosing location so you could actually change the mode on the fly.
I chose the command line since I thought it was easier.
Hope that helps
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Mathew Sam
Ranch Hand

Joined: Dec 19, 2001
Posts: 124
It makes sense if you say client can specify the database location in local mode.When in remote mode why should the client specify the file location because the server might have started before the client with a valid file location.Is it not ?
Kalichar Rangantittu
Ranch Hand

Joined: Jan 15, 2002
Posts: 240
Mark,
I am sorry but I couldnt follow you through. Are you saying that the client should be able to provide the location of the Remote DAtabase? And that the server need not be given a database name when starting?
Thanks for the input.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17233
    
    1

No, If the client is in local mode it states where the db.db file is. If the client is in remote mode it states where the server is. Meaning RMIRegistry location really.
The client does not tell the server where it can find the db.db file. When the server is started it states where the db.db file is.
Hey, I think I just came up with a better way to explain Local vs Remote. In local mode it is without RMI or Object Serialization, in remote mode it runs with RMI or Object Serialization. Whichever you are using RMI or Object Serialization. Think of stand-alone(local) vs Data residing in a central location for multiple users to use.

Mark
[ January 25, 2002: Message edited by: Mark Spritzler ]
Kalichar Rangantittu
Ranch Hand

Joined: Jan 15, 2002
Posts: 240
Its this line that gets to me
In either case the program must allow the user to specify the location of the database, and it must also accept an indication that a local database is to be used, in which case networking must be bypassed entirely".
Looks to me that it is saying which database to use from the client but also tell the client to use remote or local access to it.
Renzo Zanelli
Greenhorn

Joined: Dec 17, 2001
Posts: 5
I allow the user to specify the name and location of the remote database. In my design, the server is just a proxy (a decorator really) that provides the database with the ability to accept network connections.
Kalichar Rangantittu
Ranch Hand

Joined: Jan 15, 2002
Posts: 240
I would think that would be what the requirements say. This will enable easy switching from remote/local mode as the database name is the same. I was however not sure if specifiying the database for remote processing was a good idea.
If we supply the remote database it becomes easy at start up to determine which mode to use by showing the user with a splash regarding the same.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Client Startup and options
 
Similar Threads
NX: (HTL) FileChannel & Threads
NX: db location
NX: spec. DB location
How many modes are there for the program?
[B&S] Database location