Thursday, January 31, 2008

References for Web Architecture

One of the most important principles for web architecture is in the identification of location.  Web architecture is often violated when index expressions are employed where address expressions are appropriate. 

A browser getting a web page employs an address expression when it's not employing a dynamic view in a resource collection scheme.

An address expression is more commonly known as a resource location.

A URL (for HTTP GET) has a query expression employing indeces and possibly describing ranges within collections when it employs the query parameters syntax.  As in "/path?id=0".  This example is an index into a collection. 

An index is a component of a query expression.  An index may be a part of a range expression. 

A query expression in an HTTP GET request expresses a view or perspective on a resource collection. 

A URL (for HTTP GET) is an address expression (location) when it does not employ the query parameters syntax.  As in "path/0".  This example is the address or location of a web resource.

The difference between an index and an address can be illuminated in the context of resource editing.  A view is not employed for resource editing.  The incorrect HTTP statements "DELETE /path?id=0" or "PUT /path?id=0" violate web architecture because the URI components of these statements are not locations.  The URI employed here expresses a view on a collection of resources rather than a resource location.

The distinction resolves compatibility with many issues, both internal and external to a domain's web services.  Edge devices external to web services can readily resolve this distinction.  Client user agents, editors, and automated web services can readily resolve this distinction. 

But most importantly, a web architecture lacking collection- scheme- independent resource locations precludes the long term survivability of its own links, as well as alternative views.  It lacks a structure for its own evolution.  Its links will become broken when its view scheme changes. It is fragile.

An index expression for a single resource should redirect to an address expression (a location).  A collection view containing single resource references should point to address (location) expressions, or of course alternatively, to index expressions that will redirect to locations.

A web architecture should make a best effort to create survivable resource locations, and independent view query schemes, to avoid application silo effects in its choices.

No comments: