• 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
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

NX: UrlyBird "suncertify" package?

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Ranch Hand
Posts: 619
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

 
Chee-Chan Keng
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:
 
George Marinkovich
Ranch Hand
Posts: 619
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Always! Wait. Never. Shut up. Look at this tiny ad.
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic