Your choice of RMI or serialized objects will not affect your grade, but no other approach is acceptable. 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, the networking must be bypassed entirely."
Originally posted by Yi Zou:
To my under standing,
Network mode: you need to ask user to input hostname and port number
Local mode: you need to ask user to input the path of the file.
You can design different GUI for netwok mode and local mode.
Marco Tedone<br />SCJP1.4,SCJP5,SCBCD,SCWCD
Originally posted by Sang-Wook Kim:
Hi Yi,
But there is still one thing I dont get.
"it must also accept an indication that a local database
is to be used, in which case, the networking must be
bypassed entirely."
This applies to the local mode, right? But since I use
different command when running in different modes:
Network mode: java -jar runme.jar
Local mode: java -jar runme.jar alone
I think this is already an indication. It doesn't make much
sense running the application in local mode and asking
the user if he wants to run a local database.
Am I getting wrong? Guess so... -_-+
Sang-Wook
Marco Tedone<br />SCJP1.4,SCJP5,SCBCD,SCWCD
Regards, George
SCJP, SCJD, SCWCD, SCBCD
java -jar runme.jar alone ==> starts the application in standalone mode
java -jar runme.jar server ==> starts the application in server mode
java -jar runme.jar ==> starts the application in network client mode
standalone mode ==> database file location
server mode ==> database file location
network client mode ==> database server host
Originally posted by Sang-Wook Kim:
Can the argument "alone" of the command "java -jar runme.jar alone"
be an indication that a local database is to be used? Or do I
have to indicate it in another way?![]()
Regards, George
SCJP, SCJD, SCWCD, SCBCD
I am still a bit puzzled about these modes. I assume that the database is on the server computer. If the client has access to the server, then he will start the application in �alone� mode and specify the database location.
If the client is on another machine, he will access the application as a network client and will need an ip address and port number. He will not be able to specify the path to the database, since he has no access to the server file system.
But what is server mode for and when would it be used?
Originally posted by Simon Ingram:
I assume that the server mode is only used in conjunction with the network client. Someone has to set up the port number and file location on the server side before the network client can access the server. Have I a correct understanding?
Regards, George
SCJP, SCJD, SCWCD, SCBCD
Marco Tedone<br />SCJP1.4,SCJP5,SCBCD,SCWCD
Originally posted by Marco Tedone:
My question here is: how is the reading/updating/writing of the database performed in this mode? By means of streams?
Yes.
A major difference I would discuss here it would be between the server-network mode and the standalone. While the latter will make use of streams to write/read data from the db, I guess that the formers will also implement some serialization to move data across the wire between the client and the server. Am I right?
Yes.
Regards, George
SCJP, SCJD, SCWCD, SCBCD
Originally posted by Nicky Bodentien:
I don't think you need to make the path to the database file configurable. The requirement says "[whether you use RMI or serialized objects,] the program must allow the user to specify the location of the database", and it does so under Server --> Network Approaches. So by "the database" I think they mean "the database server".
If you accept that they are really talking about the database server, then the location would just be
the host and port if the program is running as a network client the port if the program is running as server nothing in standalone mode, since there is no server
Of course, I would feel a lot safer about my assumption if I knew someone had tried it out and passed.![]()
Regards, George
SCJP, SCJD, SCWCD, SCBCD
Originally posted by George Marinkovich:
But how can you possibly know that the examiner intends to do something like this? Well if I wanted to be able to do testing like this I might put a requirement into the assignment instructions something like: "the program must allow the user to specify the location of the database." Could it be worded better (less ambiguously)? Absolutely, but you could make that argument about a number of requirements in the assignment instructions and indeed you could make that argument about any specification I have ever seen. English, or any natural language for that matter, is an imprecise tool at best. So you would have a decent chance to argue your case and appeal any unfavorable grade you may receive. But I think a good lawyer would rather win his case at trial rather then on appeal. An even better lawyer would like to settle his case on favorable terms before he even gets to trial.
Marco Tedone<br />SCJP1.4,SCJP5,SCBCD,SCWCD
Originally posted by Nicky Bodentien:
// Reads a record from the file.
we interpret it is as
// Reads a record from the file or return a previously cached value.
Here the potential danger of our interpretation is that the record we return from the cache may be stale when compared to the record in the file. If we code to make sure that doesn't happen then does the user really care if the record came from the file, or if the record came from the cache which got it from the file. Are there circumstances in which the user is going to get different results? If not, then perhaps our interpretation is safe.
When the specification says
give up the CPU, consuming no CPU cycles,
we interpret it is as
wait using monitors (as opposed to busy waiting).
Here the requirement seems to be concerned with not wasting CPU cycles so it seems like an easy choice to use a wait monitor rather than to use busy waiting since the first wastes fewer CPU cycles than the second.
So when it says
the location of the database
in the Network Approaches section, why should it not
be as much subject to interpretation as the other statements?
Here I think there are negative consequences to interpreting this requirement to mean the user only wants to configure the database file in network client modes. That would mean that the user only wanted to be able to configure the database in network client mode, in all the other modes (standalone and server) he is content not to be able to configure the database file. That's certainly a possible interpretation of this requirement. So if you don't make the database file configurable in all modes and it turns out the user wanted to configure it in standalone or server mode then the user will probably think you failed to implement his requirement correctly.
On the other hand, if you make the database configurable in all three modes, but it turns out the user only really wanted it to be configurable in network client mode, then the client might be surprised at your interpretation of his clear requirement, but he's not going to be prevented from doing anything he wanted to do. In other words, the consequences of guessing wrong in this case is that you did extra work you didn't have to do (making the database configurable in server and standalone modes). The user is not really affected adversely by your incorrect interpretation.
Regards, George
SCJP, SCJD, SCWCD, SCBCD
Nothing up my sleeve ... and ... presto! A tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|