This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes organizing java projects Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "organizing java projects" Watch "organizing java projects" New topic
Author

organizing java projects

Edmund Castermund
Ranch Hand

Joined: May 09, 2007
Posts: 85
Hi,

this is a question of standard practices;

on my machine, pretty much all my projects are under a folder, c:\java.

within that folder is it a good idea to start using a folder structure like:
com\myDomainName\projectName\packageName\subPackageName.... and so on?

I mainly use eclipse, is it a good idea to stay away from that for awhile?
thanks,
jason
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

First of all, you should keep package names all lower-case
Using a domain name for package names is a common practice to avoid having two libraries conflicting. If you're just practicing, you can keep it simple.


[My Blog]
All roads lead to JavaRanch
sathish kumar
Ranch Hand

Joined: Feb 14, 2007
Posts: 47
hold separate packages based on your operation
for example
com.domainname.projectname.persistence ==> Keep all classes to database operation
com.domainname.projectname.controller ==> Keep all your interface based class
com.domainname.projectname.utilities ==> Keep all your utility methods.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Talking about naming, could you read the Naming policy and change your name accordingly ? Thank you
sathish kumar
Ranch Hand

Joined: Feb 14, 2007
Posts: 47
This is the fifth time, I have changed my name. I really did not get the naming policy at all. Please help with the same. I tried display name to be my fist-name with initials, last name with initial, first name-last name, javaranch user name. But I get whacked for everything :-). Please advise
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18917
    
  40

Originally posted by satsranchuser:
This is the fifth time, I have changed my name. I really did not get the naming policy at all. Please help with the same. I tried display name to be my fist-name with initials, last name with initial, first name-last name, javaranch user name. But I get whacked for everything :-). Please advise


Sathish,

Your current screen name, "Sathish Kumar", currently should pass -- meaning you should not be whacked...

There is some talk about disallowing "smith", "doe", "kumar", and other names that get abused (ie. ficticious), but it is okay for now.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Edmund Castermund
Ranch Hand

Joined: May 09, 2007
Posts: 85
Hi,

I'm revisiting this because I'm starting to work out of a book that uses JUnit. They suggest having all your source files under a structure of c:\java\src\com\domainname\packagename and c:\java\test\com\domainname\packagename.

So let's say I just start a new project that will have one class and one test; will the workspace be c:\java\src, and when I create a package I'll call it com.domainname.packagename. Will that work? should I start all my projects in the workspace of c:\java\src and then create the package names as above?
thanks,
jason
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: organizing java projects