Forums Register Login

NX: UrlyBird "suncertify" package?

+Pie Number of slices to send: Send
Hi,
I am a bit confused with the package structure for the interface file:
"...Your data access class must be called "Data.java", must be in a package called "suncertify.db", and must implement the follosing interface:
package suncertify.db;
public interface DB {...}"
".. The JAR file must have the following layout... A directory called code, containing all the source code..."
Assuming my JAR root is at c:\exam, does that mean my directory structure below is correct:
c:\exam\runme.jar
c:\exam\db-1x2.db (my data file)
c:\exam\code\suncertify\db\DB.java
c:\exam\code\suncertify\db\Data.java
c:\exam\code\Main.java (contains the main() method)
c:\exam\code\gui\... (GUI codes)
c:\exam\code\remote\... (RMI codes)
c:\exam\docs\
c:\exam\docs\javadoc
Then how do I access my data file from Main.java??? using "..\db-1x2.db"?

And where do I store the .class files? in the same directory as the .java files?

thanks!
+Pie Number of slices to send: Send
Hi Chee-Chan,
I think all your *.java files should be contained in a package of the form suncertify.xxx where xxx is db, remote, gui (whatever names you choose).
So your directory structure looks fine except for the line I've changed (in bold) below:

Assuming my JAR root is at c:\exam, does that mean my directory structure below is correct:
c:\exam\runme.jar
c:\exam\db-1x2.db (my data file)
c:\exam\code\suncertify\db\DB.java
c:\exam\code\suncertify\db\Data.java
c:\exam\code\suncertify\gui\Main.java (contains the main() method)
c:\exam\code\gui\... (GUI codes)
c:\exam\code\remote\... (RMI codes)
c:\exam\docs\
c:\exam\docs\javadoc
Then how do I access my data file from Main.java??? using "..\db-1x2.db"?

You're making the location of the database file configurable, aren't you? You could hard-code the database file location as "db-1x2.db", but give precedence to the database file location specified by the suncertify.properties file (if present) and allow the user to edit the suncertify.properties file from within your application.

And where do I store the .class files? in the same directory as the .java files?

All your class files are contained in your runme.jar, right? There's no need to include them anywhere else in your submission.

 
+Pie Number of slices to send: Send
George,
Did you forget to change the lines after Main.java, or u intend to leave them that way?
c:\exam\runme.jar
c:\exam\db-1x2.db (my data file)
c:\exam\code\suncertify\db\DB.java
c:\exam\code\suncertify\db\Data.java
c:\exam\code\suncertify\gui\Main.java (contains the main() method)
c:\exam\code\<b>gui\...</b> (GUI codes)
c:\exam\code\<b>remote\...</b> (RMI codes)
c:\exam\docs\
c:\exam\docs\javadoc
From my understanding with your post, the codes should all be under \code\suncertify, so there is really <b>no other file or folder</b> other than "suncertify" folder under \code?
I am confused with my import statement now, shouldn't they be "import code.suncertify.db" if we use the above directory structure?
I tried to follow the directory structure in Max's book, but the requirement sound different than his directory structure, which worried me :roll:
+Pie Number of slices to send: Send
Hi Chee_Chan,

Originally posted by Chee-Chan Keng:
Did you forget to change the lines after Main.java, or u intend to leave them that way?

No they're fine as they are.

From my understanding with your post, the codes should all be under \code\suncertify, so there is really <b>no other file or folder</b> other than "suncertify" folder under \code?

No all your code (in a package directory structure) is under c:\exam\code. All your code is in packages. Your package names are suncertify.db, suncertify.gui, etc.

I am confused with my import statement now, shouldn't they be "import code.suncertify.db" if we use the above directory structure?

No, for example, "import suncertify.db;" is consistent with the way your code is structured.


[ March 08, 2004: Message edited by: George Marinkovich ]
I need a new interior decorator. This tiny ad just painted every room in my house purple.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 919 times.
Similar Threads
Thoughts wanted READMDE.txt
Question about package
URLyBird: runme.jar
I am close to submit - Quetion a bout how to package
NX: Directory Structure
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 08:27:14.