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.
Suppose that you are creating a little online poll. Each poll can have a "vote type". Here are some vote types:
- Anonymous Voting
- Ip based voting
- etc.
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.
In a different, but related question, 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"?