Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

organizing java projects

 
Edmund Castermund
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
sathish kumar
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Talking about naming, could you read the Naming policy and change your name accordingly ? Thank you
 
sathish kumar
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 20993
76
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Edmund Castermund
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic