This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Grouping small classes in one file

 
Emnaki Chih
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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*?
 
Emnaki Chih
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic