title: Challenge - Keep Code and DB Rows Separate
body: <p>We all agree that the db is for storage and that the code shouldn't be tightly coupled with it.  How do you achieve this when you store preferences in the db. Let me give an example.</p>
  
  <p>Suppose that you are creating a little online poll.  Each poll can have a "vote type".  Here are some vote types:</p>
  
  <ul>
  <li>Anonymous Voting</li>
  <li>Ip based voting </li>
  <li>etc.</li>
  </ul>
  
  <p>Now if there is an interface where a user creates a poll and stores the "vote type", it seems inevitable that at some point you associate something in the db (either the primary key or a name) with the code that does 'anonymous voting' 'ip based voting' etc.  </p>
  
  <p>In a different, but related <a href="https://stackoverflow.com/questions/1050062/suggested-architecture-for-associating-code-to-db-rows">question</a>, John Sanders said that this is silly - and I do agree completely with him!  Why connect db and code - it is a bad idea.  But how do you avoid it if you are storing something like "vote type"?  </p>