title: Single v Multiple REST endpoint
body: <p>Were working on making legacy code (Java) accessible via a REST API (Java/Spring/JSON).</p>
  
  <p>Essentially our legacy code has numerous command processor type classes (which take in commands) and serve data back to the caller. So we have numerous command processors with numerous methods in them. Each method is analogous to a GET/POST of data, i.e. getCustomer / getCustomers / addCustomer etc..</p>
  
  <p>We discussed 2 options:</p>
  
  <ul>
  <li><p><strong>Option 1</strong> - Create endpoints for every operation.</p></li>
  <li><p><strong>Option 2</strong> - Create one single REST endpoint and pass in a generic payload. The JSON being passed in would have a "type" identifier which in the endpoint we could then "construct" the require object type</p></li>
  </ul>
  
  <p>I think option #1 is a better design as it's much simpler and adheres more to REST. I don't like option #2 as the single endpoint is now actually like a fancy front controller or dispatcher and would then either contain a huge switch statement.</p>
  
  <p>I'd be interested in seeing what you guys think, pros / cons.</p>