Search This Blog

Wednesday, February 6, 2008

The Ranvier URL Mapper: Letting URL Structure Invoke Application Work

The responsibility of a Uniform Resource Identifier (URI) is to uniquely
name a resource in the world. The most familiar subset of URIs is
Uniform Resource Locators (URLs), which take on the additional
responsibility of providing a description of how to obtain the named
resource (in other words, a network location and protocol to use in
fetching an electronic document or stream). Some URIs are Uniform
Resource Names (URNs) without being URLs, that is, they name a resource,
but do not provide specific details on how to obtain it... The oldest
and most popular Web servers have generated URIs whose form directly
mirrors the file system structure of the machine that hosts resources.
The URI schema itself specifies a hierarchical "path" component of URIs
(though a path is potentially empty), but does not require any literal
mapping between a URI path structure and a file system. Ranvier is a
Python package you can integrate into Web application frameworks to map
incoming URL requests to source code. It does this by a mechanism of
delegation-and-consumption, which differs from more common regular
expression-based URL rewriting. Ranvier also serves as a central
registry of all the URLs in a Web application and can itself generate
the URLs necessary for cross-linking pages. The registry function
allows Ranvier to assure the integrity of links and automate coverage
analysis. Ranvier is pure Python code and does not have any third-party
dependencies; it should be usable (with a bit of adaptor code) in any
Python-based Web application framework... There are certainly many
cases where domain resources are semantically hierarchical, and not
merely in a way that mirrors peculiarities of the development framework
and tools used in implementation. Ranvier provides a flexible way of
organizing dispatch of functional aspects of URI processing into
multiple reusable blocks of code.

No comments: