- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
There probably already was one, the guy probably didn't see it. I did the same thing for addresses, had and ObjectID and and ObjectTypeID column, then some other developer couldn't figure out how to get a customer's or vendor's address.
I don't think it's a good thing to have one table and a type field on a table from a data stand point because you can't enforce the relationship but from an application stand point it can be really nice.
Admin
Admin
Matt Langley speaks with great insight. But we all must remember this is a [US] State (or Local) Government organization. Audits, Q/A, any 'technical sensibility' do not exist!
Admin
The really hillarious part about this post, is that there are actually people who think that Word is excellent for handling mass amounts of data, that should be kept in a database, or Excel (which is better than word at least).
One of the most frustrating things about being a DBA is dealing with all the "Excel Databases" that are kept.
Admin
Actually, I hate Access DB's more than Excel ... Usually come with more WTF's ...
Admin
Admin
Admin
I think people were being ironic...
Admin
You do realize there is another way to do this where you can enforce integrity.
You have your table of (going back to the original post) images. Then each table that needs an image (be it item, location, employee, sex toy whatever) has a fk column that links back to the image table. You can even make the fk nullable. No silly object_type field needed.
"I did the same thing for addresses, had and ObjectID and and ObjectTypeID column, then some other developer couldn't figure out how to get a customer's or vendor's address."
Um... he should just get it from the customer or vendor table and follow the fk back to the address.
Does it get any simpler?
Admin
Admin
Riiighhht......... the new guy, placed on a safe task like reporting while he cut his teeth, should just start making design changes without approval. That's not a recipe for disaster...
Admin
And yes, I'm kidding. :P
CAPTCHA: kungfu
Admin
The (unusually authoritative) Wikipedia on this topic -- http://en.wikipedia.org/wiki/Plural_of_virus -- is well worth a read. I would have thought that "virii" is just silly, but apparently it's OK (if a tad precious) in the case of computer viruses...
I think I'll stick with viruses and indexes, thanks.
Admin
What, are you programming in assembly or somrthing? If you have a proper framework such as Rails/ActiveRecord that manages model associations for you it really isn't something you need to worry about. Having all your activity logs (or whatever you're working with) in a single table is too valuable to pass up. I use polymorphic associations all the time and they are great. Never once had a problem with "garbage" getting into the "type" column.
Admin
Insufficient. You want to have a record of all changes, not just adds.
Admin
That's a joke, right? damn, is my sarcasm radar malfunctioning...
Admin
We had a senior developer a while back who used "indice" as the singular. That one always cracked me up.
Admin
Amen: Heaven forbid the database should have to change to cope with a change in data model! If you have to make decisions during data design, you're doing it wrong. An Inner Platform is the best kind of platform!
Admin
Just to ensure there is not any misunderstanding, and in case the sarcasm wasn't dripping enough, my point was that a single table design is (typically) a bad thing. And it was I that had to point out to the "senior" developer that tables joins are not inherently evil. Rather that bad database design and poorly written queries are. (In other words, it was he that was doing the aforementioned non-indexed join, and many similar joins, that caused him to declare table joins the root of all CPU spikes and untimely server deaths.)
Admin
If the backend is MS-Jet (aka Access) then doubling the tables is indeed a bad thing.
Admin
"Belated pessimization is the leaf of no good."
Admin
Are developers the most intolerant, lazy people on earth or something? Doesn't anyone stand up and fight to make things right? It seems like everyone just suggests "run away from that company".
This would be like working for a renovation company, seeing a house being built where the foundation structure was compromised, and then just "running away" because you knew it was bad practice, rather than doing something about it. Then the house falls down and crushes a family.
Seniority be damned, if you know you're right, don't let yourself be stifled. At the very least submit something formal explaining to someone other than the other developers WHY this is going to be a problem in future.
Admin
My personal favorite: That's a mute point.
Admin
Yeah, but if you keep doing that, you could end up with doulbe the number of columns!
Admin
Admin
It seems like there are two types of senior developer:
Type I - Ten years of experience. Type II - One year of experience, ten times.
Type II senior devevelopers seem to be fairly common. They learn enough to produce some sort of solution, but never learn enough to do things right.
Admin
Developers must not attempt to take responsibility for more than which they have authority. Having given people the information they need to make decisions, each person must be responsible for their own decisions.
Anybody who tries to tell you differently is trying to sell you something, or make you a scapegoat; consider running.
Admin
Admin
I realize there's due process. What I'm saying is I don't like the "if there's a problem, run away" mentality that so many people on these boards seem to have.
Sure, there's a hierarchy in some (most?) companies that has to be dealt with. But while upper management may not care about database schemas, I'm sure they'll care when the database grinds to a halt and they have to pay loads of money to get it refactored and fixed.
I'd rather get fired for telling the proud proud captain that his boat has a hole in it, than sink on his ship.
Admin
I think I've seen that before: in previouse Versions of Microsoft CRM
Admin
So... why don't you have one images table with a FK in the tables whose rows need an image?
Admin
There were multiple addresses and the number and types of addresses for an object type could be changed by a user. If done your way and they needed another type of address you would have to do more work.
I forgot to mention an AddressType table, and that is what actually held the ObjectTypeID.
My way, I just tell a user to change it themselves. :)
Admin
I couldn't agree more.
Admin
Admin
After ~3yrs at a major hedge fund, I beg to differ. If you've never seen an Excel spreadsheet take 2gb of RAM and take 30+ minutes to open it's almost a religious experience.
Admin
Bah. "Orientate" is a word.
It took me a while to get used to the American "oriented", as in "Object-Oriented" which in Britain should be "Object-Orientated". Strangely, my first computer, a BBC Micro of all things, used "program" instead of "programme" (and accepted "disc" or "disk"). Auntie let me down there!
The shift from the BBC's "COLOUR" to every other language's "color" was also a real pain.
Of course, in most countries, you program in a foreign language altogether. Anyone remember Apple providing localised scripting with AppleScript?
Admin
Yes, because both are correct. Am I the only person who gets annoyed by fools who go around correcting other people without ever even having bothered to check the disputed word in a dictionary?
Admin
You, sir, have just provided my email sig line. Congrats!
Admin
Wouldn't adding a few columns to each table (case, hearing, etc.) have solved the problem? Like:
USER_CREATED USER_MODIFIED
and maybe even:
TIME_CREATED TIME_MODIFIED
Most of the time it should be enough to know when and by who the record was created/last modified, yes?
Admin
I hate people not finishing their
Admin
It's quite possible you are the only one.
Since you haven't a clue, here's a starting point... http://www.answers.com/indexes&r=67
Cheers
Admin
The really really hilarious part is that some ('KingNetSurfer') don't seem to understand the concept behind 'sarcasm'.
Admin
Hmm..I would've thought that Type I would be symptomatic of that!?
The first time they produce some sort of solution that works, they don't have sufficient reason to revisit that design. But if you move on and expose yourself to different environments, you just might get that reason.
Admin
Admin
If the captain doesn't seem to understand and you don't end up getting fired, then your options are to "run away", or sink.
Admin
Yeaaaahh! The thing is that they simply don't listen to you because you're an old tarte.
Admin
Yes, we see these exprts much too often
Admin
Maybe you can do hat in India. Try to do the same for the European Commission and you know how much you are worth.
Admin
Ooops, where is the problem?
Admin
Well, a stock exchange index is not a database index. The first one is indicating a tendency whereas the latter one is showing you where some data is located. Not really the same thing.
CAPTCHA: sanitarium (where we will all end up)