Frameworks
These days it is almost unthinkable to develop a software project without a development framework of some kind. Most development frameworks that I’ve run across invoke the MVC programming paradigm or something similar. The advantage to using a framework is threefold:
- It divides the code by its functionality (aka “the separation of concerns”). This provides a guideline for where developers should include their logic which is useful when working with a team of developers. The model (in some cases the DAO) communicates with the database, the view focuses on presentation, and the controller on logic. It’s straight-forward.
- It saves the developer time, by not having to reinvent the wheel and write code that provides the base functionality for the application like a bootstrapper, a dependency injection container, a base DAO (database access object), a base model, controller, view and so forth.
- Most frameworks have API’s that provide shortcut methods and sometimes common objects that can reduce the volume of code considerably. This is especially useful for websites which have a list of common components (i.e. forms, authentication, web services, clean urls, ajax requests, email tokens, captcha, security hashes, feed aggregation, shopping carts, etc., etc., etc.) that are cumbersome to program again and again. Even if you re-use your code as boilerplate, oftentimes clients request you customize it and this is where the libraries come in handy.
Now, I must say that if you’re a developing something simple like a website with a blog (like this one) you may want a content management system. In most cases, web application development is beyond the scope of a CMS. There are usually a multitude of frameworks for every programming language with a reasonable following. In my opinion, frameworks can divided into those that include an ORM (object relational mapper) and those that don’t.
Many web developers sing the praises of ORM frameworks, such as Django, Ruby On Rails, CakePHP and Symfony because of the added speed and efficiency it gives them. This is good if you’re a freelance web developer trying to create a small-scale specialized web application in as little time as possible. However, this doesn’t make or break the framework. With ORM’s there is an inherent lack of scalability and in many cases, it is not desireable to have your database schema follow your object model completely.
ORM’s can also make code refactoring a pain because the schema is created as you create your code, so any code changes after you have initially run the ORM, result in an extra step that can become tedious. Migrating your database with an ORM can also be a pain, especially if your switching database systems (i.e. from MySQL to Postgres).
Rather than evaluating what frameworks are superior to others I will highlight each of their strengths. As you’ll notice most of these are PHP or Python frameworks because these are the ones I know the best:
Zend – Extremely thorough library of fully scalable, object-oriented components. If you don’t want to use the MVC framework, you can simply use the components independently. Support for a multitude of database systems. Supports integration with Doctrine ORM. Best suited for professional and enterprise-level projects written in PHP.
CodeIgniter – Similar to Zend, but lighter weight, so sites run faster. It has simpler API that caters to less experienced programmers. Excellent and easy to read documentation. Supports MySQL and Postgres database systems. Best suited for PHP freelancers.
Ruby On Rails – This innovative framework is perhaps the number one reason to learn Ruby. Includes an optional and flexible ORM and an all-encompassing API, partly because it’s the only major Ruby web development option. Ships with a JavaScript library, originally Prototype, now jQuery. Best suited to Ruby web shops and freelancers.
CakePHP – Ruby On Rails with PHP. Often considered the fastest PHP framework, development-wise, due to its code automation feature. Library of object-oriented components MIT licensing so you can do whatever you want with it. Best suited to PHP web shops that take on small-scale web app projects.
Django – Features a built-in admin section, a plugin system for components which already very thorough, and an ORM meaning its built for speed rather than customization. Remarkably simple and extensible templating language that allows for the ability to create custom tags. Best suited for Python web shops and those looking integrate with Google App-Engine.
TurboGears – Self-described “megaframework”. Built on top of other popular Python projects including CherryPy, Pylons and SQLAlchemy, an extremely flexible ORM. Ships with tools for AJAX integration. Best suited to complex, enterprise-level Python applications.