title: RESTful Service Design: Calling get all resource endpoint
body: <p>Looking for some suggestions to help me design a restful service.</p>
  
  <ol>
  <li>Get all Products: what happens when a client tries to get all the products <code>/products</code>. Should I return all the products or first 50?</li>
  <li>If the service will return the first 50 or the first 100, then where should I write the pagination logic? Should I write it in the same <code>getAllProducts()</code> method?</li>
  <li>I am plan to have <code>sort</code> and <code>search</code> functionality as well. Where would these two go?</li>
  </ol>
  
  <p>Here is my assumption:</p>
  
  <pre><code>@RequestMapping("/products")
  public String getAllProducts(@QueryParam(value="page") int page, @QueryParam(value="sort") String orderBy) {
  
  @RequestMapping("/search/products")
  public String findProducts(@QueryParam(value="q") String searchCriteria) {
  </code></pre>