When should stuff be stored in a database?

From: Paul Linehan <paul_at_not.a.chance.ie>
Date: Mon, 14 Apr 2003 02:53:52 +0100
Message-ID: <q05k9vs6n3h754rei5lqbv94n4c313077n_at_4ax.com>


Hi,

This is sort of related to my previous post about indices and whatnot.

I will have a table



Create TABLE OigePayment
(
  PaymentType VARCHAR(12)
);
INSERT INTO OigePayment Values('Cash');
INSERT INTO OigePayment Values('Cheque');
INSERT INTO OigePayment Values('Draft');
INSERT INTO OigePayment Values('Direct Debit');
INSERT INTO OigePayment Values('Agent');
INSERT INTO OigePayment Values('Laser');  // a debit card
INSERT INTO OigePayment Values('Credit Card');
COMMIT;

Now, it is very unlikely that another form of payment is going to be invented any time soon, so I am wondering whether it is better to hard code the values for this parameter into the app?

I know that with any question of this sort, there is scope for debate I had a debate here recently about gender - I say 'M', 'F' or even a Boolean 'Male?', but I got back stuff about intersexes, chimerae and allsorts.

OK, as far as I'm concerned, the debate about M/F (which I do *_NOT_* store as a Gender table) is not an issue, but what I am trying to establish is when does it become reasonable to start putting things into a db as opposed to hard coding them?

Part of the reason I'm asking is that I'm working on an application at the moment with a colleague (who got the job) who doesn't know much about dbs - his attitude to virtually everything is "Just put another record in the database", and I'm trying to explain that

  1. the app should understand the data (or in this case, its own "metadata".
  2. values that are added afterwards will be ignored by the app.

This is obviously not the case with things like the, say, Member table with the Member's name, address and various other stuff - that's fine. That will appear in any report about the Members.

What I am talking about to an extent is the application's "metadata" - i.e. fields that are used to maintain info about the other records in the app. It's a bit like the system tables in IB, they maintain info about the records in the db.

I hope the above is clear - if not post back and I'll try and clarify.

Any refs, URLs or whatever appreciated.

-- 

plinehan__AT__yahoo__DOT__com

C++ Builder 5 SP1, Interbase 6.0.1.6 IBX 5.04


plinehan__AT__yahoo__DOT__com

C++ Builder 5, SP 1. IB 6.0.1.6 IBX 5.04
Received on Mon Apr 14 2003 - 03:53:52 CEST

Original text of this message