• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Switch between remote/local db required?

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I reread the instruction, I am confused with the following words:


Network Approaches
Your choice of RMI or serialized objects will not affect your grade. In either case, the porgram 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, the networking must be bypassed entirely.



So when a client is connecting to a remote database in network mode, it should be able to switch to a local database, and the networking is bypassed. In other words, switch the mode on fly. Am I right?
Previously I thought the mode is defined by the command line argument and will not change through the program life.
Thanks for any help.
 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We aren't required to provide the "switch on the fly" functionality. However, the user must be presented with an option to work in local or network mode when the application is loaded.
I think there have been people that did add this ability, but it's outside the scope of the core requirements. I guess it's really up to.
Hope this helps.
 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
From my point of view the instructions are quite specific on this: you must use a single commandline argument "mode" indicating the mode the application has to use...
greetings,
TK
 
shan chen
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for all replies. English is not my first language and I am not clear about the sentence here.
Does "In either case" only covers "the program must allow the user to specify the location of the database", or it also covers the rest of sentence?
If the former is the case, no switch on fly.
If the latter is the caes, we may need switch on fly.
Does the case mentioned in "in which case" included in "in either case" or not?

I hope no switch on fly.
Thx.
 
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The "in either case" refers to the previous sentence "Your choice of RMI or serialized objects (for the networked version)...".
So you can ignore it, and read the next sentences as:
1. "The program must allow the user to specify the location of the database."
2. "The program must accept an indication that a local database is to be used."
3. "When a local database is used there must be no networking code".
Even for a person with english as a first language there is a lot of "noise" in the assignment instructions that has to be filtered out. In fact the first step should be to rewrite the instructions making a checklist of the things that "must", "should", "may", "must not" be done.
-Barry
[ May 04, 2003: Message edited by: Barry Gaunt ]
[ May 04, 2003: Message edited by: Barry Gaunt ]
 
shan chen
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Barry. I have another question related property file.

All configuration must be done cia a GUI, and must be persistent between runs of the program. Such configuration information must be stored in a file called suncertify.properities which must be located in the current working directory.


But in section "Packaging Submission", it does not mention suncertify.properties. So it just is an optional? The program can use default property and does not allow reconfiguration. Is it correct?
Thanks to any comments.
 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Shan,
You suggested: The program can use default property and does not allow reconfiguration.
I think this will limit your client application to only running on the same machine as your RMI registry. This may be how the examiner chooses to run your application, but I would not want to force them to do this.
If you decide to allow the client application to be on a different machine to the RMI registry then you are going to need to tell the client application where to find the RMI registry.
As soon as you do that, you fall into the clause:

configuration ... must be persistent between runs of the program


That is, the examiner should not have to re-enter the address of the RMI Registry each time they run your client application. Therefore you need to store that information, in a file you will create named "suncertify.properities". The name this file is given should give you a clear idea of which classes the examiner expects you to use.
Regards, Andrew
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

All configuration MUST be done via a GUI, and MUST be persistent between runs of the program. Such configuration information MUST be stored in a file called suncertify.properities which MUST be located in the current working directory.


Hi Shan, see those "MUSTS"? There's no optional allowed there. If you do not do those "MUSTS" you are doomed.
 
shan chen
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, Andrew, Barry.
I am actaully not clear about the instruction:
<quota>All configuration MUST be done via a GUI,
</quota>
It implies properties is configured with some GUI.
<quota>and MUST be persistent between runs of the program.</quota>
Does this mean suncertify.properties is just configured once, then no changes any more?
<quota> the examiner should not have to re-enter the address of the RMI Registry each time they run your client application.
</quota>
Andrew, I think the host name still needed when a client starts.
What my code does now is:
1.when server starts, it reads in port and dbfile name from suncertify.properties, displays them in a dialog. User can re-configure or just leave them unchanged. The new properties will be saved back to suncertify.properties. The server then starts with the new port and new datafile, if changed.
2. when client starts, it displays a dialog first, asking for host name and port number, then connect to the server according to the input. The client <bold>DOES NOT<bold> read suncertify.properties, because it does not have an <bold>updated</bold> suncertify.properties, unless the server can send it to the client. But how can the server know where the client is?
Thanks to any comments!
 
Andrew Monkhouse
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Shan,
Please be careful with your UBB codes - they are not HTML codes, so angled brackets (<,> ) dont work. They have to be square brackets ([,]). And the word is QUOTE, not QUOTA (case doesnt matter).

All configuration MUST be done via a GUI,
It implies properties is configured with some GUI.


If you are suggesting one application to set up properties, then multiple applications (Client GUI and Server) read these properties, then no - this is wrong.
What you are doing (on the server) is correct: load the configuration, allow the user to change them, save them back to the parameters file, then continue with the main application which uses the parameters that were either edited or approved by the user.

and MUST be persistent between runs of the program.
Does this mean suncertify.properties is just configured once, then no changes any more?


Substitute "persistent" with "remembered".
So if the examiner enters port number 1234 the first time they run your application, then the next time they run it, they should be offered port 1234 as the default.
However they can change it without any problems.

the examiner should not have to re-enter the address of the RMI Registry each time they run your client application.
Andrew, I think the host name still needed when a client starts.


Agreed. I was not suggesting that it would not be needed. See my earlier comment about remembering values. The examiner should only have to enter the value once. Every time they start your application after that, it should have remembered the host name, and offer it as the default. They can change it, but they dont have to. And more importantly, they dont have to re-enter it.
Your description of how the server works looks correct to me.
Your client program though, has left out the important step of saving the data to file so that it will be persistent (remembered) for future executions of your program.
Regards, Andrew
[ May 06, 2003: Message edited by: Andrew Monkhouse ]
 
shan chen
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Andrew,
Thank you for your suggestion.
For the origianl question, I got the SUN reply:


The instructions do not specify that users can switch databases dynamically.
It's ok if the mode and database are set
only once, at startup time.

 
It will give me the powers of the gods. Not bad for a tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic