Analysis of Drupal as a Framework

Posted on Nov 18 2007 in Web Development

I recently presented at an event where several web application frameworks were discussed, including Drupal. Around that time I was also working on several projects written as Drupal modules at a level that I had not done before. These series of events caused me to take a step back and consider Drupal's merit as a web application framework.

I've often fought with myself in my head about whether a large web application would be best developed from scratch, based on a loose framework (such as CodeIgniter or CakePHP), or based on a large, existing platform such as a CMS. Typically I would have said that if you're writing a relatively complex application, that it might be best to use a loose framework for pure time saving and best practice adherence.

However, I feel that my opinion may be shifting. Many web application share basic components: authentication, authorization, URL routing, user management, etc. The features that typical web applications share read almost as a feature list for a CMS. What Drupal manages to do is not only implement those typical web application features (well), but also expose a considerable, well-thought-out set of APIs that allow programmers to take full advantage of Drupal's core features and wield them for their own purposes.

Node API

One of my favorite subset of Drupal's features is the node api. This system allows the programmer to create modular content types for which Drupal will control all aspects of CRUD, requiring the programmer to write only the code which will dictate that content's behavior that is different than the norm, such as the layout of a specialized form or storing extra data in the database.

Form API

The Form API is another example of one of those systems that I've found myself often imagining programming for myself. I've often though, "There has to be a way to write a system that will make doing forms and the related HTML not suck so much." The Drupal Form API is that system that I've desired for so long. Creating a form is as simple as populating a rather simple array, describing each field's properties in short form.

Conclusion

I would encourage anyone looking for a framework, nay, a platform upon which to build their web application to carefully consider Drupal. I'd venture to say that just about anything you'd want to accomplish is either already implemented or is (relatively) easily accomplished using Drupal's API and core modules, let alone the community-contributed content.