"All right, Jory, we're gonna start you off simple here, kid!" Jory B.'s boss was a large man with forearms like hairy hams, and he spoke in a gruff, deep, and loud voice. "Yer gonna learn about The Aggregator by adding a simple feature. I want it to be sendin' emails whenever someone signs up at one of our locations!" He continued on his throaty, saliva-y explanation of what should appear in the emails, which mail server to use, and so on. "Welcome aboard, kid," he said warmly, extending a hand with fingers that looked like sausages.
Jory dodged flying saliva droplets while his boss spoke. "Thanks. And can do!"
The Aggregator
Jory first assumed that The Aggregator was some kind of templating system for the 25 mostly-identical web sites for the various gyms, country clubs, and rec centers that used it. After some high-level review, however, he figured out what it was for – The Aggregator simply received data from the 25 gyms' web sites regarding new applicants, allowing the call center staff to view the information from one interface.
To say that Jory didn't like what he saw would be an understatement. He was astonished at the way much of the technology was developed.
For one, the database didn't have any constraints of any kind defined: no uniques, no foreign keys, no primary keys, though it was clear that some tables had columns that were meant to serve as a primary key. For instance, intuserid: defined as a nullable integer. Not an IDENTITY. On each insert, it would determine the ID by using MAX(intuserid) + 1. There were hundreds of nulls and dozens of duplicate user IDs.
Furthermore, The Aggregator never actually received applicants – each of the 25 web sites wrote directly to the central database whenever someone filled out a form online. What's worse, the 25 different sites each had their own little quirks. Random files were different on one site from the next, and rather than using a central template, it appeared that the designer had done a sitewide search and replace for the name of the gym and contact information in each site, in addition to different fields on forms, features that worked differently on one site from another.
It became clear that Jory wouldn't be able to complete what was supposed to be a modest task with The Aggregator in such a ridiculous state, short of a trigger that would fire on every insert to send an email. Jory returned to his boss with his tail between his legs. "I'm sorry, I don't see a good way to do this..."
"What?!" Jory's boss pounded a heavy fist on his desk. "What could be so hard about sendin' an email?" Before Jory could respond, his boss continued "Ah, sorry kid. I'll just get the original guy on this. Next time don't let me down!"
The Architect
The Architect showed up later that day. He was tall, very slender, with a thin mustache. If he had a cap with a "W" on it he'd look like Waluigi. When he stood near Jory's boss, it was as though it was two sides of a funhouse mirror. The three of them discussed the change.
"Heh, that's it?" The Architect scoffed. "I'll have it in tomorrow."
"Great!" Jory's boss exclaimed with a phlegmy voice.
On his way out, the architect smirked at Jory.
The following day, Jory's boss pulled Jory aside to talk. "Look, kid. The architect got his email sendin' code in, and I want you to look at it so you can take the next feature."
Sheepishly, Jory replied "sure."
The Feature
Jory cursed his stupidity for not just adding the INSERT trigger, which would have complicated the system further but gotten the job done. Plus it was in rough enough shape already anyway, but he promised himself he wouldn't lose face by not completing the next request.
So let's see what this guy did, Jory thought to himself. Probably a change to the database. Reviewing the database and any relevant stored procedures, though, nothing had changed. OK, maybe it was done as a change to The Aggregator. Again, when he actually looked, there were no changes.
Suddenly, he reached a sickening revelation. Oh god, he must've... After a few keystrokes and clicks, Jory confirmed it. The Architect had simply written, copied, and pasted the email sending code and uploaded it to all 25 sites.
Hopefully this incident has reinforced the tenets of Front-Ahead Design for Jory. Remember, "do what it takes" and "code light, not 'right.'"