[Pdx-pm] (OT) SQL style question

David Wheeler david at kineticode.com
Thu Jan 13 16:32:49 PST 2005

On Jan 13, 2005, at 4:01 PM, Kyle Dawkins wrote:

> Well, here's where I am still not quite getting you... if you are 
> creating an abstraction, then store the meta-information in your O-R 
> model, not in the DB column names... if your abstraction needs to know 
> that columns A, B and C come from table X and columns D and E come 
> from table Y, then why wouldn't you store that in your model?  I don't 
> quite understand why you need to derive that information from the DB 
> schema... especially since you want to support different DBs, which 
> will almost certainly have different naming conventions.  You should 
> move it up into a mapping system, and perform all reads through that 
> mapping system.

It's more to be self-documenting, but as I said, the O-R mapper needs 
to know where to look, and the more opaque things are, the better.

> Good good... definitely the right idea.  But if you haven't already 
> started a higher-level model of your underlying DB schema, now is the 
> time.  It will save you tons of grief and prevent you needing to 
> answer the question you posed to this list because the whole issue 
> becomes moot; all column names become irrelevant (which doesn't mean 
> you shouldn't name them consistently, just that the format you use is 
> not relevant to your code).

It's not relevant, it just makes it easier or more difficult to write 
the O-R mapper or to diagnose issues when you look at the database 
schema directly.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2369 bytes
Desc: not available
Url : http://mail.pm.org/pipermail/pdx-pm-list/attachments/20050113/b34d6b6c/smime.bin

More information about the Pdx-pm-list mailing list