title: Java REST web service constructor
body: <p>Is there any point in having a constructor in a Java Web Service class? (There seems to be no consensus in the articles I have found so far.)</p>
  
  <p>I am using <strong>Jersey</strong> to implement a <strong>REST web service</strong> that needs to have a non-static common object (a string-processing utility class) made available to various (non-static) methods of the service.</p>
  
  <p>Initializing this common object would typically happen in the <strong>constructor</strong> of the class, if that were not a web service. But what about now that it is?</p>
  
  <p>If a constructor cannot be used, should I put, in every relevant method, a <strong>synchronized block</strong> that checks whether the common object is available and, if not, initialize it? Or is there a better approach?</p>