title: mongoose best-practice with data layer in node application
body: <p>looking into the nodejs server stack with nodejs/express and mongoose</p>
  
  <p>What is considered a best practice solution?<br>
  (1) Creating a mongoose datamodel module then working with the model objects<br>
  (2) Creating a wrapper datalayer module that will internally use the mongoose model</p>
  
  <p><strong>Pros for (1)</strong><br>
  I really like the OOP style classes mongoose gives me, add my own methods, my own setters and getters, I can add validation and event-handlers, and use the DataModel without redefining it in another module.</p>
  
  <p><strong>Pros for (2)</strong><br>
  I should be able to mockup the data layer with simpler implementation (tests, etc..)
  or switch a database if needed.</p>
  
  <p>What do you think?</p>