Relational Database Patterns?
pole asks: "Are there common relational database patterns (schemas, stored procedures, triggers, etc.) which can be effectively reused? These could be "upsert" (update or insert) patterns, temporal database patterns (historical data such as human resources records or time-series data), referential integrity patterns or even code generation patterns (good programmers don't reuse code via cut-and-paste). Can you think of useful RDMBS patterns? Would be great if these were part of a repository with use-cases and examples that actually worked. Is there such a beast?"
Despite the fact that many old SQL folks get very upset when they see things like the complete absence of stored procedures and triggers, I know from personal experience that (many of) his recommendations work just fine.
As a general simple example, a basic invoicing system would include a customer table, a saleperson table, an invoice table, a line item table, a partnumber table, an inventory table, etc, etc, etc.
Now we add to this the specific demands of the company such as auto-calculation of local and regional taxes, preferances for data entry screens, the exact data that the user desires to be stored, ease of use issues so that the sales geeks can actually use the system, requirements of suppliers in terms of ordering a variety of items, etc....
It becomes a bloody mess because of the intense customization required. There is no standardized way of running a business. Each CEO/CIO/CFO etc has their own ideas regarding the specific details on how things should be set up.
Thus we have the market for companies that provide business solutions for specific markets and business types. Each one requires a specific expert knowledge of the demands of that particular industry, with all of the quirks that go with it. Within that industry you can something stand could serve as a standard, but it would likely be promoted by a single dominant solution provider of some sort.
"It is a greater offense to steal men's labor, than their clothes"
Over here at the Enzyme open-source project, we've been working on several libraries that help PHP developers access data in a RDBMS using OO techniques designed to promote code reuse. We don't have a lot of theoretical stuff done yet, but we're giving away a lot of code :)
Can your IM do this?