Introduction to Web Frameworks

Jed Laundry


It's always been a recurring theme that developers love to code their own solutions, especially when it comes to websites like blogs etc. Using an existing package such as WordPress is so quick and easy, its almost uncool. Besides, when you write your own code, you can fully customise things to suit your needs. I've been down this path many times; I used to write everything from scratch, and by the end I had a stock template for designing a site. I really loved the fact that all of my pages would render start-to-finish in 0.0149s (without caching), not to mention that I could recycle code from just about anywhere. But writing your own sites has major disadvantages and setbacks; it takes a lot longer to get done, there's no explicit group of people to turn to if you come across problems, you have to start worrying about security, and unless you have a keen insight on architecture it can quickly get out of hand. This is where web frameworks can come in really handy.

In today's developer dreamland, there really is a large group of stable frameworks that can not only handle high-volume traffic, but make it incredibly easy for developers to write code without worrying about mundane details, such as security. A lot of these are open-source, and are supported by such a vast community that any problem you encounter can be solved quickly with a few well-crafted searches. Depending on requirements, you're (mostly) free to "Shut up and hack". knowing that at the end of the day you're not going to break the build. Not to mention, there's a decent framework for just about any programming language, so while some features are framework-dependant, most things you can do with python can be done with ASP.net, can be done with php, and can be done with Ruby.

Another big push towards frameworks has been the drive behind MVC (Model, View, Controller) archetectures. MVC, for those not in the know, is a really productive way to code, as it encourages code reuse and tries to keep your application segmented, making sure you've properly defined contracts between functions. It was originally developed in the 1980s for Smalltalk applications, however with the recent Web 2.0 uprising it became apparent that it applied quite nicely to web applications. Clean URLs is probably the best example of this; in a correctly implemented MVC archetecture, a URL will be comprised of www.your-domain.com/class/function/id, or some variant thereof depending on your requirements. For example; on my site, for each blog post I use /article/id/random-human-readable-text format.

So, there are already numerous frameworks out there, and as I said they are written for a myriad of languages. Django for phyton, CodeIgniter for php, DotNetNuke for ASP.net just to name a few. But if you're a fellow Microsoft student geek, you should definately have a look at the upcoming ASP.net MVC extensions. It's currently in preview stage of development, and the team is always looking for suggestions on what developers would like to see in a final release. I strongly suggest you to go have a look at it (http://www.asp.net/downloads/3.5-extensions/), have a play and see what you can come up with. It's not a production release, but I've yet to be able to break it. And, if you have suggestions, make your voice heard so that when it does hit release status, the features you need are in there. Heres an idea; make a blog application using ASP.net MVC, and blog about your experiences, and your feedback to the team!


About Jed

Jed is the Microsoft Student Partner for the University of Waikato. He is a second year BCMS student, works part-time as a developer for Alcatel-Lucent, and keeps a blog at http://www.jlaundry.com/