• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

gui-network interface help needed

 
Pavan Dile
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey folks,
I just started working on SCJD the assigment.
The requirement mentions "The user interface should connect to the database using either a local or network based connection according to the user's choice." Somewhere down the line, it adds, "..In either case, the program must allow the user to specify the location of the database.........in which case the networking must be bypassed entirely."
Now in local mode, one can browse for a file.. and chose it as a db. How does one perceive this in network mode??
Another school of thought would be to simply replace the remotehost named string with "localhost" in case of local db. (apparently, this contradicts sun's requirement).
So, which of these two approaches makes more sense.
Thanks in advance
--Pavan
Red Eye consultant
(Frequent user of Fly by night services)
 
Thomas Fly
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A lot of people seem baffled by the "local" connection requirement, but for one thing, it's the most natural approach to take when you're first trying to get something to work (and, of course, your probably-RMI server will connect to the database "locally," so you can't avoid writing that code anyway.
You may want to consider passing the database file-location / server-URL as command line arguments. You can also (perhaps in addition to a command-line argument) have a configuration file that specifies these things... and since it's now legal to use j2sdk1.4, you might even want to make the config file XML... But you can certainly stick with j2sdk1.3, and still make a perfect score.
Look at SimpleRMI (be warned that it contains some of my fooling-around code that you'll need to remove).
 
Pavan Dile
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Thomas,
The XML-config file idea sounds exciting.
--Pavan
 
Thomas Fly
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I were using j2sdk1.3, I'd probably use java.util.Properties.
XML is touted for being "portable" of course, and it also offers the option of changing (and screwing up...) the application's configuration with just a (free ) XML editor.
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The XML-config file idea sounds exciting.

Are you going to require that the accessor edits this config file before he can run your app? If so, you may fail automatically.
Eugene.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic