Re: naming conventions for columns, primary and otherwise
- From: "--CELKO--" <jcelko212@xxxxxxxxxxxxx>
- Date: 17 Jun 2006 10:20:59 -0700
The one rule of yours I disagree with is this one:<quote>Table names are in plural form, for example, persons, materials, addresses. </quote> <<
Not quite right; my rules are:
1) Look for an industry standard name That is, use VIN and not
"automobile_id" for the purpose identifying a car.
2) Look for a common name That is, use "ClassRoster" instead of
"StudnetTeacherCourse" for a class roster. Relationship tables are bad
about this one
3) Use a collective name. That is, we have "Personnel" and not
"Employees".
4) Use a plural name, if no collective name exists. Thus "Kangaroos"
is okay ... well if you did not know that a collective noun for
kangaroos is a "Mob", but that word is so weird that people would miss
it.
5) Use singualr name, if the table actually models a single unique
entity (or ios empty). An example might be a configuration set-up.
To my mind, a table of people is a table in which each row is a person. <<
No quite; that is the whole point of Cantor's set theory versus
Hilbert's Hotel. We do NOT think of a set as elements; we think of the
set as a completed whole. The forest is not indivdual trees.
The table should be named for the rows it has in it. <<
So, instead of "Personnel:", we should call it "DilbertWallyAlice"?
That is what naming a table for the rows it has in it implies. This
also why newbies give relationship table those weird hypenated names.
Oh, when we add "Loud Larry", the name should change?
What we are modeling at that level of abstraction is a set (personnel)
and not the elements (current employees). This also has the advanatage
in SQL of preventing a table and column from having the same name (no
problem for the parser, but bad for maintaining code).
Just like in C programming an array is a container in which each element is a single thing. <<
Wrong mental model. Think of an array as a container in the abstract,
but ignore the contents, the dimensions, etc. You probably follow my
abstraction rule with arrays!
Would you name an array for the contents? No. Let me use a classic
"Eight Queens" array problem. Would you name the array "Chessboard"
whch is what it models or name it "Q1Q2Q3Q4Q5Q6Q7Q8" after its
contents? Would you name a Sodoku array "SodokuGrid" or some name
based on its 81 cells of content?
.
- References:
- naming conventions for columns, primary and otherwise
- From: metaperl
- Re: naming conventions for columns, primary and otherwise
- From: Michael Zedeler
- Re: naming conventions for columns, primary and otherwise
- From: Gints Plivna
- Re: naming conventions for columns, primary and otherwise
- From: metaperl
- naming conventions for columns, primary and otherwise
- Prev by Date: Re: naming conventions for columns, primary and otherwise
- Next by Date: getting the list of macros in approach
- Previous by thread: Re: naming conventions for columns, primary and otherwise
- Next by thread: Re: naming conventions for columns, primary and otherwise
- Index(es):
Relevant Pages
|