This week's book giveaway is in the General Computing forum.
We're giving away four copies of Learning Regular Expressions and have Ben Forta on-line!
See this thread for details.
Win a copy of Learning Regular Expressions this week in the General Computing forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

URLyBird - Configuration  RSS feed

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody,

Well, although I'm new to this forum, I actually have already written most of my SCJD project (URLyBird). Just going over some of the issues I've been through. So I have several questions, any insight will be greatly appreciated.

My first question would be about the configuration of the data access server.

Clearly, when running in stand-alone mode, no such configuration is needed. The GUI simply prompts the user for a file name (using a ) and that's it.

However, some questions arise regarding running the program in "server" mode.

What I did (so far. This is the part that I haven't quite completed yet) is just use hard-coded values for the following items:

* Listening port
* Database file name

And when the program runs as server, a small, empty frame pops up and minimizes itself immediately. This frame creates a thread for running the listener. The reason I chose to use a frame instead of just a console application is the ease of coding the Shutdown Handler. In the "frame" way, when the user chooses to close the frame it's rather easy to shut-down everything tidily; whereas if it was a console application, handling a Ctrl-C event is trickier.

Since the spec did not specify which items (if at all) need to be configurable, then it is theoretically OK to hard-code the listening port (I'm using sockets) and the data filename as I did.

However still it doesn't seem right to me.

How about you guys? Are you showing some GUI when running the program in "server" mode, so the user can configure it?


Thanks,


Isaac
 
Ranch Hand
Posts: 1033
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Isaac Shabtay:
How about you guys? Are you showing some GUI when running the program in "server" mode, so the user can configure it?



I provide a small GUI that shows the network and file status and provides menu items to configure these, shut down the server, and display help. You could catch HeadlessException and just run as a console app if that's thrown when creating the JFrame.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!