tags:

views:

47

answers:

3

I'm working for a company where our design team has elected to use "Field1".."Field10" as generic, future purposed columns. I have queried them as to the reason and was told that they are there in case we need them in the future.

Has anybody heard of this practice? Is it wrong for my jaw to drop to the floor when I see something like this?

+3  A: 

You are not wrong at all. Not sure what the difficulty is in writing an ADD COLUMN change script.

If these are columns that are not being referenced by the application (and can not used by it at all), then this is the worst kind of YAGNI abuse.

However, if this is a product that will be deployed at maintained by people not in your company, it makes sense to put such place holders (assuming the application "knows" how to access and use them) for future unforeseen expansion.

Oded
+1  A: 

In practice? Well, there's this little set of applications called "Oracle eBusiness" that has boatloads of columns with names like ATTRIBUTEn, where n runs from 1 - 20 or more. The application configuration on top of those gives business meaning to them, but that's what the tables look like underneath.

On the other hand, some applications create custom database tables on the fly - this requires more sophistication in some of the code, but less in others (and, IMHO, less configuration silliness). Just be glad you don't have some sort of craziness where all custom fields are stored in a single key-type-value table - I've seen that too, and it's just wrong.

Harper Shelby
Wasn't it Oracle that brought us Oracle Forms? 'Nuff said... :-(
Pontus Gagge
Thank you, this is probably why we're doing it. The output from these columns end up on a paper printed report, so it's likely similar to this situation. Maybe they're afraid to add columns?
Eugarps
@Pontus Gagge: I don't think it's the best solution, but it can work.@Sprague: Creating the mechanism to add columns based on user customizations is not trivial. That's the sophisticated part - well, that and being able to have the front end application track those changes. It requires a lot of metadata generation by the application, where the 'generic columns' solution requires user (or consultant) configuration, and is a lot easier to code.
Harper Shelby
The "single key-type-value" thing is commonly referred to as an Entity Attribute Value table.
Marcus Adams
A: 

Encountered it, yes, even in so called commercial products. Generally it happens when people don't really understand relational databases, and don't care about future maintenance costs.

Granted, relational databases aren't really great at handling future proofing. You generally need to evolve the schema and provide data migration paths for upgrades. This can seem more complicated and expensive up front, but compared to anonymous columns without any kind of data integrity checks... groan!

Pontus Gagge