aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes URLyBird 1.2.2: some questions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "URLyBird 1.2.2: some questions" Watch "URLyBird 1.2.2: some questions" New topic
Author

URLyBird 1.2.2: some questions

weiqun zhu
Greenhorn

Joined: May 10, 2005
Posts: 2
I have been reading the posts here from time to time and it truly help me a lot. Now I am going to submit by assignment this week and have some questions to ask you guys:

1. The instructions about package submission doesn't mention the readme.txt
file, should I include one?

2. I have a file called db.properties, it is the start information about
the database file: like
Start of file
4 byte numeric, magic cookie value identifies this as a data file
4 byte numeric, offset to start of record zero
2 byte numeric, number of fields in each record

I use it to retrieve the meta data for accessing the database file.

Right now, I have two choices to put this file:
a. Including it in the application .jar file, same as the
database file. Once a standalone or server application is
started, ask the user to choose the file (it maybe in any
directory) to use.

b. Including it in the runMe.jar file root directory, disable
the choice for a user to select the file.

I prefer the first way, but I don't know if it is good or not to
let the examiner to choose the file.

3. This question actually related with the first two:

The instruction list the files I need to submit, I don't know if it
is allowed to add these two files into the submissions.

Thanks for suggestions!

SCJP 88%
SCWCD 88%
[ July 25, 2005: Message edited by: weiqun zhu ]
Frans Janssen
Ranch Hand

Joined: Dec 29, 2004
Posts: 357
Sorry, pressed wrong button!

You can edit your posts by clicking the edit icon above it. (The one with the sheet of paper and the pencil.)

1. The instructions about package submission doesn't mention the readme.txt
file, should I include one?

What should be in the readme file?
I don't think it is forbidden to include a readme file, but I do think that it is pointless: since it is not required to add one, you cannot depend on the assessor reading it. So if there is any vital information you want the assessor to read, put that into the user documentation file(s). (choices.txt when it is about your design or userguide.txt if it is about how to operate your application.)

2. I have a file called db.properties, it is the start information about
the database file: like
Start of file
4 byte numeric, magic cookie value identifies this as a data file
4 byte numeric, offset to start of record zero
2 byte numeric, number of fields in each record

I use it to retrieve the meta data for accessing the database file.

Right now, I have two choices to put this file:
a. Including it in the application .jar file, same as the
database file. Once a standalone or server application is
started, ask the user to choose the file (it maybe in any
directory) to use.

b. Including it in the runMe.jar file root directory, disable
the choice for a user to select the file.

I prefer the first way, but I don't know if it is good or not to
let the examiner to choose the file.

I would go for option b. It does not seem user friendly to make the user choose which database format he wants to use. The user does not care about such things! You might also hardcode the database format into your application, since you can identify the format by the magic cookie in the file.

3. This question actually related with the first two:

The instruction list the files I need to submit, I don't know if it
is allowed to add these two files into the submissions.

I think it is allowed to inclued all the extra files you need, but do not depend on the assessor looking at/using them.

Frans.
[ July 25, 2005: Message edited by: Frans Janssen ]

SCJP 1.4, SCJD
weiqun zhu
Greenhorn

Joined: May 10, 2005
Posts: 2
Thanks, Frans! Your reply really clear my mind, I guess I went too far.
I have another question to ask, the sample code(in a method) is:

String[][] fieldInfo = this.dbMeta.getFieldInfo();
String temp = fieldInfo[DBMeta.FIELD_LENGTH_INDEX][fieldIndex];
int fieldLength = Integer.parseInt(temp);

I don't know if I should break them into sth like:

String[][] fieldInfo;
String temp = "";
int fieldLength = 0;

fieldInfo = this.dbMeta.getFieldInfo();
temp = fieldInfo[DBMeta.FIELD_LENGTH_INDEX][fieldIndex];
fieldLength = Integer.parseInt(temp);

or not.

Sorry for bothering you again!
[ July 25, 2005: Message edited by: weiqun zhu ]
Frans Janssen
Ranch Hand

Joined: Dec 29, 2004
Posts: 357
I have another question to ask, the sample code(in a method) is:

String[][] fieldInfo = this.dbMeta.getFieldInfo();
String temp = fieldInfo[DBMeta.FIELD_LENGTH_INDEX][fieldIndex];
int fieldLength = Integer.parseInt(temp);

I don't know if I should break them into sth like:

String[][] fieldInfo;
String temp = "";
int fieldLength = 0;

fieldInfo = this.dbMeta.getFieldInfo();
temp = fieldInfo[DBMeta.FIELD_LENGTH_INDEX][fieldIndex];
fieldLength = Integer.parseInt(temp);

or not.

I think that would be a matter of personal taste. If you asked me, I would prefer the first way.

Frans.
 
 
subject: URLyBird 1.2.2: some questions