title: Client/Server - Updating an entity
body: <p>We are using an ORM framework (Hibernate). Our model contains many entities. We use spring framework with angularJS based client. The whole communication is ajax based through REST services. We use mainly DTO Objects between client and server with marshaling of Jackson (json->Pojo). The web application is targeted for mobile as well as for PC (primarily PC).</p>
  
  <p>We are now debating on the flow (client - server) to update an entity. At first glance this looks pretty easy:</p>
  
  <ol>
  <li>client sends the update request to the server</li>
  <li>server executes the update and responds with an acknowledge message.</li>
  </ol>
  
  <p>After discussing the flow in more detail we raised some questions:</p>
  
  <ol>
  <li><p>What exactly should the client send to the server?</p>
  
  <ul>
  <li>should it send the whole entity object? </li>
  <li>should it send a map of (fieldName, NewValue)?</li>
  <li>if the client does send a map - how does the client knows about the fieldNames? do we need to agree upon pre defined names?</li>
  <li>if we agree on pre defined names - how the server interprets them? does the server keeps a map of  fieldName - > actual DB fieldName for updates?</li>
  </ul></li>
  <li><p>How does the server executes the update?</p>
  
  <ul>
  <li>Should the server execute a different update script for each different field that changed?</li>
  <li>Should the server execute a single huge update script that is being altered according to the client request?</li>
  </ul></li>
  </ol>
  
  <p>We have been looking for a day now for articles \ posts about this simple notion and couldn't find any references.</p>