• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

gui-network interface help needed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
 
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic