This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I would suggest that you use a class. The class can be package private when you don't want the constants to be seen outside the package. The constant interface pattern (usage of interfaces for just declaring constants) should be avoided.
I'd resist doing all of the constants for a system in one place. You'll make it hard to reuse any subset of your system without dragging that whole constants class along.
You can usually find them a home along with the classes that really need them. For example, if you have a set of constants for log message severity they probably belong on the Logger class or in the logger package.
Also look into Enums. In Java 5 and later they can replace some constants like those severity levels in nifty ways. [ March 07, 2007: Message edited by: Stan James ]
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com