Project 6.2

April 13, 2011

Objective

Project 6: Design and implement a database-backed program using a modern ORM tool.

Project 6.2: Create a simple application that exposes you to using ActiveRecord and MySQL.

Scenario

*munch* *munch* *munch*

"Hmmm... nope, still here." *munch* *munch* *munch* "Drat, not this one either..."

"O. M. G. Look at your mouth," says your roommate as he stops in front of your bedroom doorway on the way to the shower. "You've got red stuff all around your mouth again. You look like a clown! I understand that you're a believer in all that The Mines stuff but come on... eating all those red candies is just going to rot your teeth. Do you really think there's some magic red pill out there?"

"Look, it's none of your business!" you shoot back, frustrated. "I know none of this is real and the truth is out there. Wait, that's from the X-Files. Anyway, look, I'm a hacker, see, you wouldn't understand!" Under emotional stress from school and your adventure, you begin to sob.

"Hey, heeeyyyyy, I'm sorry -- "

"No, no... you're right. This is ridiculous. All this time I thought my adventure was more than just a vehicle of procrastination. And I hate red cinammon candies. *sigh* I really should do my database reading and quiz."

"Well, look, try to let it go. If it's really out there, The Mines or Morpheus or whoever will certainly find you. I mean, so you took the blue pill, what's the big deal? Anyway, you can start by washing that clown-looking stuff off your face. I'll be out of the shower in a minute."

45 minutes go by and you still hear the shower running. "Hey, are you ok in there?"

"Oh sure, just washing my hair," shouts your roommate. "What, tired of looking like a clown with that red st -- I -- grr -- uggh -- bwhhhaaagh" You hear a huge ruckus from behind the bathroom door. Suddenly the door opens and you can hardly believe your eyes. Before you stands a clown in a black suit menacing before you!

"Mr/Ms (your name)," says the clown, "please come with me. You are going to build an application for us with ActiveRecord, and you will like it."

Completely shocked, you only manage to faint.

Requirements

Your goal with this assignment is to start with the premise that you have a complex application that uses objects to encapsulate "things" and you want those objects' data to persist to a database with a minimum of programming effort. Who wants to manually code common database / persistence functions? Not you.

Using just a portion of the WikiMedia schema (images, users, pages), you must implement the ActiveRecord classes necessary for a few simple CRUD operations. This is a very exploratory project, so you will need to consult the ActiveRecord API for details, and use the forum to ask questions and provide answers. You are allowed to change your database schema in order to fulfill the domain requirements of the program.

Start with this boilerplate code that shows you which classes your application uses, and shows a procedural outline of what your program needs to do.

Grading Criteria (600 pts)

Submit your MySQL database dump (should contain INSERT statements as a result of data added by your program) and your ruby script to blackboard. You will be graded on the fulfillment of the requirements, listed as comments in the provided Ruby script.

This is due by 11:59PM on Wednesday, April 20.