title: Handling full and partial views in jersey for a REST API
body: <p>I am working on creating a RESTful API for a project. I am facing a few problems trying to implement it with jersey:</p>
  
  <ol>
  <li><p>My object model does not contain uri info obviously. e.g, lets say I have a Fruit class. Fruit object would have let's say a FruitName and a FruitColor. But in the response I also need to send a URI. How is this usually handled? Should I create a separate "FruitResource" that has a constructor which takes a "Fruit" and creates a full resource from it, including URI? I need URIs in the nested objects as well, e.g if I am returning a list of <code>Child</code> objects, I need each <code>Child</code> object to also have a URI, but I donlt want the URI to be part of the object model. What is the cleanest way to do this?</p></li>
  <li><p>I want to have capability to return full and partial views of the same resource. Partial views would just have the name and the URI for example. How to get this done?</p></li>
  </ol>
  
  <p>Right now what I have is a <code>Service</code> class that accepts the requests, which uses the <code>DAO</code> to create and return the objects as they are modelled from the DB, serialized to JSON using jackson.</p>