Friday, March 2, 2007

WK6 - AJAX Framework Introduction

Ajax framework forms part of Ajax; a technology to build dynamic web pages on the client side.

The goal of the framework is to provide this Ajax engine and associated server and client-side functions.

Benefit of a framework

A framework eases the work of the Ajax programmer at two levels: on the client side, it offers JavaScript functions to send requests to the server. On the server side, it processes the requests, searches for the data, and transmits them to the browser.


JavaScript and Server Technology Independent Frameworks


Many AJAX frameworks and libraries rely solely upon JavaScript and contain no server components, therefore no server technology dependencies. Such AJAX libraries and frameworks include:

  • Apache XAP. Open Source Ajax Framework for large scale JavaScript applications
  • qooxdoo is one of the most comprehensive and innovative Open Source (EPL/LGPL) multipurpose AJAX frameworks. It includes support for professional JavaScript development, a state-of-the-art GUI toolkit and high-level client-server communication.
  • Clean AJAX. Easy-to-use AJAX engine based on messages.
  • Dojo Toolkit. Uses packages and reusable components.
  • Helmi Open Source RIA Platform. Flexible open sourced rich internet applications / AJAX framework.
  • JackBe. A commercially licensed framework.
  • JQuery Lightweight JavaScript framework that emphasizes the interaction between JavaScript and HTML
  • Mootools. Very compact and modular javascript framework.
  • Prototype. Is the base of several other frameworks.
  • Sarissa a open source cross-browser wrapper for native XML APIs
  • SmartClient. Full GUI stack, SOA-style declarative integration with XML or JSON services, using XPath.
  • WinLIKE. A free/commercial framework to include rich windows functions.
  • Yahoo UI Library. A client-side framework that bundles several API's including an AJAX API, several DHTML interface components, implementations for extended behaviour.

Such frameworks are agnostic as to what server-side technology you choose to use. Usually such frameworks are optimized to consume XML, though JSON is becoming popular as well.


Python frameworks


These frameworks require the Python programming language to run, and the goal is to bring together several Python components designed to help in building web applications. Examples of Python frameworks include:


Let’s get further upon Django.


Django Components


The core Django framework consists of an object-relational mapper which mediates between data models (defined as Python classes) and a relational database; a regular-expression-based URL dispatcher; and a view and templating system.

Also included in the core framework are:

  • A form serialization and validation system which can translate between HTML forms and values suitable for storage in the database.
  • A caching framework which can use any of several cache methods.
  • Support for middleware classes which can intervene at various stages of request processing and carry out custom functions.
  • An internal dispatcher system which allows components of an application to communicate events to each other via pre-defined signals.
  • An internationalization system, including translations of Django's own components into a variety of languages.
  • A serialization system which can produce and read XML and/or JSON representations of Django model instances.
  • A system for extending the capabilities of the template system by writing and registering custom functions for use in templates.

Bundled applications


The main Django distribution also bundles a number of applications in its "contrib" directory; among them are:

  • The dynamic administrative interface.
  • An extensible authentication system.
  • Tools for generating RSS and Atom syndication feeds.
  • A flexible commenting system, which is able to attach comments to any valid object in a model.
  • A lightweight, standalone web server for server-independent development and testing.
  • Tools for generating Google Sitemaps.
  • Tools for preventing cross-site request forgery.
  • Tools for allowing one Django installation to manage multiple websites.
  • Template libraries which enable the use of lightweight markup languages such as Textile and Markdown.

Server arrangements


Django can run on Apache under mod_python, or under any WSGI-compliant web server. Django also includes the ability to launch a FastCGI server, enabling use behind any web server which supports FastCGI.

The following databases are officially supported for use with Django:

Adapters for Microsoft SQL Server and Oracle are under development, but are still experimental.


The Django Book


The Django Book is a free book (released under the GNU Free Document License) about the Django framework. It's currently in beta and will be published sometime in 2007 by Apress. The current version of the book can be found at http://www.djangobook.com/


Reference: