Tony Marston:
>[...] I have learned over the years that there are
Thanks for this, Tony.
I just read your document, and found it interesting. Good stuff for
novice developers, and plenty of items to at least give (another)
consideration for experienced developers.
You won't really benefit from a "Yes, I agree" after each paragraph
that I like, and therefore I just mention a couple of your opinions
that I have a slightly different take on. Please, see them as
discussion openers, only...not as some harsh critique.
1. "All tables should be named in the singular, not the plural."
-----------------------------------------------------------------
Since I have started using plural for table names, I have never
regretted that decision. "SELECT ... FROM customers" sounds so much
more logical than "SELECT ... FROM customer". It even makes discussing
tables and queries with clients during workshops more natural.
However, I use singular as long as we're working with E/R-models, only.
In data modeling workshops, where database tables aren't on-topic yet,
I'd have a "Customer" entity, an "Article" entity, etc.
2. [Passing context to child programs]
"This context can be passed as a simple string in the format
<pkey_name>='<customer_id>' such as customer_id='12345'. Provided that
the column name(s) in the primary key are *exactly* the same as the
column name(s) in the foreign key then the receiving program can use
the passed context without the need for any additional processing."
------------------------------------------------------------------
In a web environment, where query string contents are open to all, I
generally don't like to mention database, table or field names. Passing
a value for customer_id='12345' would, in my applications, look
something like
http://mydomain.invalid/?cu=12345 or similar. Color me
phobic.
3. [Normalization]
"Having proper table names and column names is one thing, but that is
not the end of the story. To make the insertion and subsequent
retrieval of data as efficient and effective as possible it is also
necessary for the database designer to go through a process called
'data normalisation'."
-------------------------------------------------------------------
This point sounds as if it was added later, almost like "Oh yeah,
before I forget, let's just mention normalization, too."
In the context of your document, I would either leave it out, or make a
major point of it. Thinking of it, I would leave it out. The order of
magnitude of the topic of normalization is much different from your
other (valid) points. In fact, I'd rather see a well-normalized
database that violates half of your advice topics than a non-normalized
bunch of tables with proper naming conventions and key definitions.
4. [Tone]
Examples: "Trying to mix the two methods is a sure sign of a very
confused mind."
"...such arrogant nincompoops should be forced to ..."
-------------------------------------------------------------------
Please, allow me to add, that I have hesitated to reply after reading
your document. By using phrases like the above, you don't really
encourage your readers to get down to work immediately and implement
your advice. It's not the advice that they won't like, but the tone of
parts of the document, that may make them click it off the screen and
never return.
May I suggest that you try and write your document for your friends,
for your friends only, and consider all readers your best friends, who
don't deserve any name calling or top-down rebuking?
--
Erick