Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

dvd_db directory in Max's sample project

 
Bob Chandler
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey people,
I'm not off to a very good start here....
I've searched for info and tutorials that would help me to understand classpaths, file storage and directories but haven't come across anything that helps.
I have Max's book (The SCJD Exam with J2SE 1.4) and have downloaded and unzipped the source code for Dennys DVDs - so far so good....
I configured system properties as outlined in pages 7...11.
Now, on page 65, I am trying to run the client program (there is a note telling me to create a directory named dvd_db etc...)
In the past, I have saved source code in the bin directory of the JDK as I was taught at college. Should I continue with this?
Is a directory just a folder?
Where exactly does the downloaded source code for this project belong?
If anyone knows a site with a good, simple explanation of file storage and classpaths etc., that would be splendid!
Bob (tempted to apologise for being a dozy twonk but deciding against it) Chandler
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12007
215
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bob,

In the past, I have saved source code in the bin directory of the JDK as I was taught at college. Should I continue with this?

I would recommend against ever putting code in the bin directory of the JDK.
You need some way of knowing what code you have written for any given project. If all the code for every project you have written is in the one directory, you are going to have to manually sort it out at some point.
Worse - the bin directory contains the executables that come with Java. So you also have to know which are the files that you have created, and which files came with the JDK.
It is much better to define a path structure somewhere else on your hard drive, and keep your projects separate - so have one master folder to contain all your projects, and within that have one folder per project.
For example, I might have a top level "java" folder which contains every project I am working on, and within that I have a "scjd" folder for the SCJD project, a "violet" folder for when I am working on the Violet UML program, etc.
Within each of these project folders, you should create a directory structure which will hold your source code, compiled code, documentation, and related files. Again, it is very valuable to keep these separate - if I need to send code to another developer, I can grab just the "src" folder and its sub folders and send it out.
Max describes a typical project structure in the section "Organizing a Project" which starts on page 17.

Is a directory just a folder?

Yes, they are the same thing.
If I talk about the path C:\WINDOWS\TEMP then I am talking about the TEMP directory which is in the WINDOWS directory which is in the <ROOT> directory of C: drive. Or I could say it as the TEMP folder which is in the WINDOWS folder which is in the <ROOT> folder of C drive.
Directories are what a folder is representing. A directory contains a list of items. For example a phone directory contains a list of names, addresses and their phone numbers. A computer directory contains a list of files.

Folders are the newer way of describing directory structures, brought about by GUI's typically showing a directory with a folder icon.
Most people use the terms interchangably. You will find the term "directory" more prevelant if you are using systems where you do not always work in GUIs. If you are working in a Unix environment it might be rare to hear anyone talk about folders .

Where exactly does the downloaded source code for this project belong?

If you follow my earlier suggestion of having a folder for all your java work, then sub folders for each project, then you might have a folder structure similar to:
C:\JAVA\MaxBook
Then, following Max's suggestion, you would put the source code in a "src" folder within that:
C:\JAVA\MaxBook\src
Regards, Andrew
 
Bob Chandler
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Andrew,
thank you so much for this detailed explanation, now it
makes more sense to me and I shall be more organised in future!
...time to empty my junk out of the bin methinks...
cheers mate,
Bob
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic