Design decision needed! I’m breaking my head over our user interface. We make quite elaborate geographical water-related websites at work (you can see a screenshot at http://lizard.org/). A heading with some navigation, a sidebar, a map (and possibly text and graphs in addition to it), some UI buttons here and there, that sort of stuff.
The question: how much ajax should we use? This is also an important question for Django as a whole. I remember Jacob’s keynote in Berlin in 2010 where he effectively said that all those new-fangled dynamic internet thingies were a potential risk to Django:
The web is in flux. NoSQL is taking up fast. Which can be a problem with Django’s original sql-only approach. And what about html5, client side storage, etcetera? It is in any case a challenge of what we know. Jacob’s tip: challenge yourself by examining all those nifty new scary technologies.
My thoughts are probably a bit old-fashioned. But I’d also like to think my thoughts still make solid engineering sense. Here are some of them:
Everyone on the team can understand Django’s urls. Even if we tie lots of apps together. If we use backbone, we’ve got two urls.py files to handle: Django’s and backbone’s. And Django is set up for multiple apps (which we have) and I’m not so sure about backbone.
You want DRY (don’t repeat yourself), so you cannot make both a django template and a json one. You can have only one, so you must have an empty bare-bones html page. So it means a couple of extra requests to build up the entire page. They might be quick, but it are a couple of extra requests.
Just fetching one sidebar is fine, but often (in our case) you need to update other page elements as well. So do you request a json for every one of the page elements (map buttons, print links, breadcrumbs)? Or a special UI json? Or do you put that info in the “main” json you request, even though that means hard-coding UI information into what’s supposed to be plain data json?
Opinions? Tips? Can you suggest a different way that I should look at this problem?
My name is Reinout van Rees and I work a lot with Python (programming language) and Django (website framework). I live in The Netherlands and I'm happily married to Annie van Rees-Kooiman.
Most of my website content is in my weblog. You can keep up to date by subscribing to the automatic feeds (for instance with Google reader):