title: Ajax methods - which is better?
body: <p>I have a bunch of insert, update, and delete operations I need to execute via Ajax. Which of the following would be a better approach?</p>
  
  <ol>
  <li><p>Individual methods for each function (e.g. delete_foo, insert_foo, update_foo, delete_bar, insert_bar, update_bar, etc.)</p></li>
  <li><p>A "master" method and just pass a parameter to distinguish between operations.</p></li>
  </ol>
  
  <p>A benefit of #2's approach would be that common things in the individual methods, such as validation or id decryption, etc. could be consolidated. However, it would also mean this master method would fairly large.</p>
  
  <p>Having a master method call the individual method wouldn't be such a great idea, I think. The reason is that the individual methods, if stripped of the common tasks now handled by the master method, are one-liner codes (for the most part).</p>