Django sports great features that make it appealing to any web developer. Foremost among them, it is free (free as in both beer as well as speech) and easy to install. It provides an administrator interface to save the developer from having to write one. The template system, at first glance, is simple enough for a layperson to learn. Django boasts a "rich, dynamic database-access API" as well as "pretty, cruft-free URLs." Its built-in support for authorization, session management, caching and on and on make it robust. Django is "not just scaffolding," they claim: it's "the whole house." Luckily, the learning curve, based on my first dozen-or-so hours using it, does not seem overly steep. Best of all, Django is tied to Python, which is a fun, coder-friendly programming language.
The Don't Repeat Yourself (DRY) Principle is manifested in Django through its model-view design pattern. By decoupling the model and view layers, which is an example of loose coupling, the code becomes pluggable—"that is, each particular app should be transferable to another Django installation with minimal fuss." Even a Django app's URL bindings can be broken off from the project and brought into its own file, making those pluggable as well.
Django follows the MVC architectural pattern by containing data within database classes, which are abstracted through an "object-relational mapper." In the official Django tutorial, the first lessons begin with models, around which views which represent them are constructed. The instructions also lay out the process of creating forms which, through HTTP POST requests, function as controllers to modify the model and update the view's presentation.
Google's framework is strikingly like Django. Coming from a lower-intermediate background in developing web apps with Google App Engine, the similarities between it and Django are easy to notice. One of the most salient features is GAE's procedural language, which is syntactically akin to Django's Python API[1]. Even more obvious is that both two are written for Pythonistas, although GAE also supports Java and their own language, called Go. One of Django's advantages is that the developers own their data exclusively, and they can control their own servers. The downside is that configuring one's own web servers can be difficult and may be more expensive than using Google's Megastore, their app-hosting software-as-a-service system.
Given the choice, I would much prefer to develop in Django. Although scaling can be a painful, burdensome task, I enjoy getting my hands dirty and learning about hardware. Implementing web services in Django would be more of a learning experience, and learning (under optimal conditions) is fun. Another factor is whether confidential data can be kept on Google's servers, or not. The main deciding factor in the real world, though, is simply which would cost more. Hosting on Google could be pricey, but purchasing your own hardware could cost even more. To decide whether to rent or own, one must do the math and hope the estimations are correct.
1. https://docs.djangoproject.com/en/1.4/topics/db/queries/
No comments:
Post a Comment