title: Enums VS Classes VS Interfaces
body: <p>I have been reading a lot of posts on this site regarding the usage of constants.</p>
  
  <p>Question: 
  When should I use Enums for constants, vs using classes or interfaces. </p>
  
  <p>I see 2 key situations I am looking to address.</p>
  
  <h3>1. Global Constants used in a applications by multiple projects.</h3>
  
  <p>Example: </p>
  
  <ul>
  <li>Common logging strings </li>
  <li>Container references like a database mapping reference used in 
          WebSphere EAR's </li>
  </ul>
  
  <h3>2. Object Specific Constants</h3>
  
  <p>Example:</p>
  
  <ul>
  <li>Employee pay rates for an Employee Object </li>
  </ul>
  
  <p>From everything I have read this is what I think I have a grasp on and what I am looking for an opinion on. </p>
  
  <p>For situation 1: 
  Design Approach: Use a final class and a static import.<br>
  Seen here: <a href="https://stackoverflow.com/questions/2659593/what-is-the-use-of-interface-constants">What is the use of interface constants?</a></p>
  
  <p>For Situation 2:
  Design Approach: Apply the use of Enums to represent those constants as a object. </p>
  
  <p>Additional points to remember: </p>
  
  <ul>
  <li>If the constant string belongs to the class and you only need the string value keep in the class that uses it</li>
  <li>Don't use an Interface for situation 1. As mentioned in the link above as Constant Interface Anti-pattern. 
  . </li>
  </ul>
  
  <p>Thanks in advance for thoughts and opinions. </p>