DelvarWorld.com

Multimedia and Tech Blog

Model View Controller Restructure

Nov 28, 2007

Some of you guys are probably saying, hey, where did the site go over Thanksgiving? I know I was. To simplify everything else I'm about to say in this blog post for the non technical viewers / people with social lives: I redesigned the back-end structure of the site. I've spent many days doing it. You will notice no changes to the site except a few more things are broken now. "What?!" you say inbrededly, "I am disgusted!" Well to explain exactly what's going on, I need to get kind of technical. So feel free to skip the rest of this blog entry.

I've always wanted to make this site object-oriented in design, A because it's the cool thing to do in the programming world, and B because I want to expand my PHP development skills. So I started researching object oriented code paradigms for websites, and I learned for the very first time about something called the "model view controller" architecture. MVC is an abstract design structure that is apparently the hippest buzzword for web development nerds these days. I don't really do a lot of thinking for myself so I jumped on the MVC bandwagon and started to rebuild the site from scratch. To teach you more about this delightful architecture, here's some Apple guy with a guitar:

Model View Controller Song


I've been exploiting my inordinate amount of free time during Thanksgiving break to work on the site. I've been coding for about four days straight now. I forget to eat sometimes. I woke up at four PM today and I don't know when I will fall asleep again. Much of this process has been a bitch to implement with random and numerous pitfalls along the way. However, this whole system has introduced some very nice code solutions. For example, all of the pages now have automatic administrator handling, making it much easier for me to perform maintenance on the site. The music page for example is exactly ONE line of code, which renders the entire page and wires up all the entries for administrative privileged editing. This is all thanks to the modularity of the MVC design. The controller for the music page grabs the music data from the database wrapper (model) through a query, then sends that data to the template (view), which renders it following certain guidelines provided by the controller, such as page title.

Because of Apache regex rewrite problems, if you want to access the forum or Bubble's Revenge, you have to specify the index pages of those files. These will work:
Valid links for: Bubble's Revenge and the forum.
Those shenanigans should all be cleared up eventually, but use those links for now. The photography viewing page will be down for a while because I want to implement a new interface for it.

The technical stuff is mostly over. The main reason I was able to do all this work on the site over break is because RIT gives us two weeks off for Thanksgiving break. This is a neat plan that was brewed up two years ago and unfortunately hasn't rotted, died and fallen off the academic body yet. The problem is that the second week of Thanksgiving break is severed from the last week of Christmas break, so our Christmas break is too short and our Thanksgiving break is too long. This schedule is the institute's solution to the international student complaint that they don't have enough time to go home over Thanksgiving if the break is only a week long. This is certainly a valid complaint, but I submit that if there was extra time on Christmas and Thanksgiving break were shorter it would work out better for everyone. Firstly, international families don't celebrate Thanksgiving, so it's unlikely that all family members will be home or even have time off from life and jobs. I'm not saying that the families all celebrate Christmas either, but it's a more globally accepted holiday, and with a longer break over Christmas there will be more quality time. Then the rest of us kids who live in the states can stop complaining that the schedule is broken and doesn't line up with any of our friends' school schedules! That's my solution with the little information about the situation that I have. Go back to the way it was. Works for every other school in the states.

I'm signing off for the night. Don't forget to keep buying those Schrodinger and Riemann t-shirts! It keeps me fed.