This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Grouping small classes in one file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Grouping small classes in one file" Watch "Grouping small classes in one file" New topic
Author

Grouping small classes in one file

Emnaki Chih
Ranch Hand

Joined: Sep 01, 2004
Posts: 30
I have a lot of really small custom Interfaces and exceptions (and so I have loads of java files). I was wondering if its a good idea to put all the exceptions in one file and put all Interfaces in another. If this is not a good idea could someone explain why not?
Garrett Rowe
Ranch Hand

Joined: Jan 17, 2006
Posts: 1296
I guess the question I would ask is why do you feel having a bunch of .java files is a problem that needs to be *solved*?


Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter
Emnaki Chih
Ranch Hand

Joined: Sep 01, 2004
Posts: 30
It clutters up my IDE, I find that its getting harder and harder for me to locate my normal java files.
Stary Kapec
Ranch Hand

Joined: Dec 04, 2005
Posts: 81
Suppose I had to find one of your interfaces that is not placed in it's own file I would have to search through all your files and scan them.


It clutters up my IDE, I find that its getting harder and harder for me to locate my normal java files.


I think it is a matter of project organization. Consider using packages and separate class files from java files
[ January 14, 2007: Message edited by: Jasiek Motyka ]
 
GeeCON Prague 2014
 
subject: Grouping small classes in one file