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 know there are many recommendation for Constant class. but some time it is convenient to declare constant in interface. for example say,
I have a specification like below:
there may be x, y, ..z client who may create extra return like ERROR -1 blah, blah(they may create extra constant class)..... but some may required exactly either ON or OFF. why i should allow this client to create one more file for constant. I could have create one more constant file in my API and serve o client but why the extra file? and client have to read the file also..
It used to be thought it was a good idea to have constants in interfaces, but that caused problems when a class implemented that interface. Those constants became part of the public interface of all those classes. More recent thinking has it that those constants can be put in a class and imported into any classes needing them. You will find a bit more here, including a reference to Joshua Bloch’s book.
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