title: RESTful services design - singleton services?
body: <p>I have earlier developed an application that exposes a set of RESTful services. I have designed business logic implementation classes and corresponding repository classes completely stateless and they get instantiated every time there is client request. Now I am developing another application with few RESTful services. In this case, one of the services gets data from some other external service and needs to cache that data for some amount of time. I am thinking to cache that data in my application DB and provide it for each request by creating a new business class object. But here I have a doubt - is this correct design? Should I make the business logic class singleton and maintain state (i.e., cache data in memory)?</p>
  
  <p>Please share your thoughts.</p>
  
  <p>Thanks</p>